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

bazelbuild/rules_nodejs 0.3.1 cannot find npm #17

Open
freaksdotcom opened this issue Jul 14, 2020 · 2 comments
Open

bazelbuild/rules_nodejs 0.3.1 cannot find npm #17

freaksdotcom opened this issue Jul 14, 2020 · 2 comments

Comments

@freaksdotcom
Copy link

This is fixed in 0.4.1 or later.

@freaksdotcom
Copy link
Author

freaksdotcom commented Jul 14, 2020

Using rules_nodejs 0.5.2:

***********WARNING***********
crisper: npm_install will require a package_lock_json attribute in future versions
*****************************
ERROR: /private/var/tmp/_bazel_bhigh/946bef48ed3737c679e24a61c6da01fb/external/crisper_repo/BUILD.bazel:5:1: no such package '@crisper//': npm_install failed:
> [email protected] postinstall /private/var/tmp/_bazel_bhigh/946bef48ed3737c679e24a61c6da01fb/external/crisper/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

 (npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN lifecycle npm is using /private/var/tmp/_bazel_bhigh/946bef48ed3737c679e24a61c6da01fb/external/nodejs/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
sh: node: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bhigh/.npm/_logs/2020-07-14T23_49_58_013Z-debug.log
) and referenced by '@crisper_repo//:crisper_bin'
ERROR: Analysis of target '//chrome_ext:options' failed; build aborted: no such package '@crisper//': npm_install failed:
> [email protected] postinstall /private/var/tmp/_bazel_bhigh/946bef48ed3737c679e24a61c6da01fb/external/crisper/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

 (npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN lifecycle npm is using /private/var/tmp/_bazel_bhigh/946bef48ed3737c679e24a61c6da01fb/external/nodejs/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
sh: node: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bhigh/.npm/_logs/2020-07-14T23_49_58_013Z-debug.log
)
INFO: Elapsed time: 6.563s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (213 packages loaded, 4260 targets configured)```

@freaksdotcom
Copy link
Author

Adding scripts-prepend-node-path=true to $HOME/.npmrc allows it to build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant