Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Errors when installing a GitHub repo dependency with a prepare script using a command from a dev dependency #2084

Closed
jaydenseric opened this issue Oct 29, 2020 · 0 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@jaydenseric
Copy link

Current Behavior:

npm v7 errors when installing a GitHub repo dependency that has a prepare script that uses a command from a dev dependency. The command appears to be missing when run by the prepare script.

Expected Behavior:

npm v7 should be able to install GitHub repo dependencies that have a prepare script without an error, like npm v6 could.

Steps To Reproduce:

Try npm install with this package.json:

{
  "name": "npm-prepare-script-test",
  "private": true,
  "dependencies": {
    "extract-files": "github:jaydenseric/extract-files"
  }
}

Notice the error:

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/jaydenseric/.asdf/installs/nodejs/14.15.0/bin/node /Users/jaydenseric/.asdf/installs/nodejs/14.15.0/.npm/lib/node_modules/npm/bin/npm-cli.js install --only=dev --prod --ignore-prepublish --no-progress --no-save --cache=/Users/jaydenseric/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --before=
npm ERR! > [email protected] prepare
npm ERR! > npm run prepare:clean && npm run prepare:babel && npm run prepare:jsdoc && npm run prepare:prettier
npm ERR! 
npm ERR! 
npm ERR! > [email protected] prepare:clean /Users/jaydenseric/.npm/_cacache/tmp/git-clone-5acc15a1
npm ERR! > rm -rf public
npm ERR! 
npm ERR! 
npm ERR! > [email protected] prepare:babel /Users/jaydenseric/.npm/_cacache/tmp/git-clone-5acc15a1
npm ERR! > babel src -d . --keep-file-extension
npm ERR! npm WARN invalid config before="" set in command line options
npm ERR! npm WARN invalid config Must be one of: null, valid Date string
npm ERR! sh: babel: command not found
npm ERR! npm ERR! code ELIFECYCLE
npm ERR! npm ERR! syscall spawn
npm ERR! npm ERR! file sh
npm ERR! npm ERR! errno ENOENT
npm ERR! npm ERR! [email protected] prepare:babel: `babel src -d . --keep-file-extension`
npm ERR! npm ERR! spawn ENOENT
npm ERR! npm ERR! 
npm ERR! npm ERR! Failed at the [email protected] prepare:babel script.

If you use npm v6.14.8, there is no error and the package successfully installs.

Environment:

  • OS: macOS 10.15.7
  • Node.js: 14.15.0
  • npm: 7.0.3, 7.0.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants