-
Notifications
You must be signed in to change notification settings - Fork 28
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
Installation fails with npm v7 #185
Comments
Update: seems like the problem is actually with npm v7. On a fresh install of node 14.16.1, which uses npm 6.14.12, |
Oh, that's odd that it would break. |
Any idea for what else I could test to track it down? |
Need to debug first what the issue is there, and I don't have a handy npm7 install to test. |
@andronocean could you try to update to the latest version of npm7? |
@lirantal I tried it with npm 7.9.0 on both node 14.16.1 and node 15.14.0, same error unfortunately. I also tried installing in a project instead of globally, no change. But! I just found a workaround. It's definitely the postinstall script that's causing the failure. I tried |
Oh nice, thanks for sharing! :-) |
Installed with silly log level, getting these:
|
I think it is possible that npm7 is now allowing the sort of interactivity that the preinstall script in npq is defined. I recommend that the fix would be to detect if we're being installed with npm >= 7 and if so to not run that bash script, but instead print to stdout the instructions and recommendation of running that script to get npq added to the shell preferences. We'll likely maybe need to expose another bin that installs that, something like |
@lirantal npm7 will no longer print output for lifecycle scripts of packages being installed by default, thus not allowing for this type of interactive Could I suggest maybe adding instructions to run this script as a manual step after the global install? (maybe provide a top-level command to make it simpler to your users) |
Thanks Ruy, that's a good idea. The npm7 behavior is not to allow interactiveness or not allowing any output printing at all? (or both?). I'm asking, because I'm happy to add another bin entry for a small script that adds the shell config, but I was thinking of prompting the user about this as part of the A side question - is there a reliable way to determine the current version of npm within a |
You can use the |
🎉 This issue has been resolved in version 2.0.23 🎉 The release is available on: Your semantic-release bot 📦🚀 |
For some reason,npm install -g npq
fails during the postinstall script when using Node 14.16.0. In my case Node is installed with nvm, however, the npq install works fine on 14.15.4.Edit (see update below):
npm install -g npq
fails during the postinstall script when using npm v7.Expected Behavior
Installation leads to the usual "Thank you for installing npq... do you want to add aliases?" prompt. This works fine with Node 14.16.1 and npm 6.14.12.
Current Behavior
I've tried both a local install (without -g) and the normal global install, with the same result. The prompt text is printed in the middle of the error, before it exits:
Relevant lines from the debug log:
Your Environment (edited per update):
The text was updated successfully, but these errors were encountered: