openid / AppAuth-JS

JavaScript client SDK for communicating with OAuth 2.0 and OpenID Connect providers.

Repository from Github https://github.comopenid/AppAuth-JSRepository from Github https://github.comopenid/AppAuth-JS

Powershell support

Falven opened this issue · comments

Expected Behavior

[REQUIRED] Describe expected behavior

npm run-script --silent build-app should not rely on unix commands as to stay cross-platform.

Describe the problem

'rm' is not recognized as an internal or external command,
operable program or batch file.

[REQUIRED] Actual Behavior

npm run-script --silent build-app

'rm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @openid/appauth@1.3.0 prepare: npm run-script --silent build-app
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @openid/appauth@1.3.0 prepare script.

[REQUIRED] Steps to reproduce the behavior

clone the repository and run the script from a powershell environment.

[REQUIRED] Environment

  • AppAuth-JS version: 1.3.0
  • AppAuth-JS Environment (Node, Browser (UserAgent), ...): Windows 10
  • Source code snippts (inline or JSBin)

Temporary solution would be to use git for windows shell, but really it should stay cross-platform.

Pull requests would be greatly appreciated here.

One way to solve it is with above suggested PR. Tested it on Windows 10, also ran npm test successfully after my changes, seeing all tests succeed on Windows. (I don't know much else about this repository, to be frank :D)

You can use WSL.

Workaround:
In package.json find:

"clean": "rm -rf built"
replace by:
"clean": "rmdir /S /Q built"

or instead use this line to be compatible with unix and windows:
"clean": "(rm -rf built || rmdir /S /Q built)"

Windows users will see the rm not found error in console, but the command succeeds with the alternative command provided.