akamai / boomerang

End user oriented web performance testing and beaconing
http://akamai.github.io/boomerang/
Other
1.86k stars 292 forks source link

NPM install fails #313

Closed blissdev closed 3 years ago

blissdev commented 3 years ago

Installing with NPM npm install boomerangjs fails because the postinstall instruction fails.

From my npm install log:

50934 error code ELIFECYCLE
50935 error syscall spawn
50936 error file sh
50937 error errno ENOENT
50938 error boomerangjs@1.720.0 install: `bower install && webdriver-manager update --versions.chrome=$(google-chrome --product-version)`
50938 error spawn ENOENT
50939 error Failed at the boomerangjs@1.720.0 install script.
50939 error This is probably not a problem with npm. There is likely additional logging output above.

It seems to me this install scripts make a lot of assumptions about the install location that may not be true. Would the project be open to dropping the install instruction?

Tested on: NPM v6.14.7

nicjansma commented 3 years ago

Hi @blissdev!

Yeah, we expect a global bower and webdriver-manager to run.

Maybe we should switch it to a postinstall task that runs from the .bin?

"scripts": {
  "postinstall": "node_modules/.bin/bower install && node_modules/.bin/webdriver-manager update --versions.chrome=$(google-chrome --product-version)",
}
nicjansma commented 3 years ago

Unfortunately that doesn't work on Windows

'node_modules' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! boomerangjs@1.720.0 postinstall: `bower install && node_modules/.bin/webdriver-manager update --versions.chrome=$(google-chrome --product-version)`
npm ERR! Exit status 1

Seems NPM fixes the path for bower, but then NPM tries to run the command after && and doesn't know to fix the path for webdriver-manager.

Instead, this seems to work, by splitting it into two npm run commands which don't need a ./node_modules/.bin/ prefix:

  "scripts": {
    ...
    "postinstall": "npm run bower-install && npm run webdriver-manager-update",
    "bower-install": "./node_modules/.bin/bower install",
    "webdriver-manager-update": "./node_modules/.bin/webdriver-manager update --versions.chrome=$(google-chrome --product-version)"
  },
blissdev commented 3 years ago

Thanks Nic!