-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Error on the new version of NPM #13293
Comments
It tries to make a hardlink, which is not allowed on android. Same issue as in #11293, where |
I think we should patch this, if this version of npm is what we provide |
Maybe we should report this issue to https://github.com/npm/cacache? We have patched it using https://github.com/termux/termux-packages/blob/master/packages/nodejs/deps-npm-node_modules-cacache-lib-util-move-file.js.patch, but if user tries to update |
@GuriZenit, we are talking about native Termux environment and not proot based distributions (including third party ones). |
We really need a gimmick that forbids users' updating npm, if the patch is not likely to be merged upstream. Could be just a matter of documentation though. |
Yeah sure @xtkoba, we can add a notice to the npm's global install script when installing npm. Just wait for some time though. My main device is for repair so I can't test the binaries built by CI. Once it comes, will look into it |
It seems that |
Still have the error, both now and when testing in v9.2.0 release. does it work for you? |
Emmm... It seems to work on Bluestacks, but not on my real device. I will record it and report upstream. |
Same here :/ |
Use |
Just pushed 6b05a8e. Will now include an error message when trying to install npm globally. Also using |
So, uh, any other way to upgrade npm? |
Error;-; ERR! Can't install npm globally as it will very likely break installation of global packages using npm. See #13293 npm ERR! A complete log of this run can be found in: |
@ItsAleph I think I may have found a way! Ironically, the suggestion by @OurCodeBase works perfectly for this: using
Oh my machine, this runs without errors. After installation, |
No, But leaving the system-wide If I need a more up-to-date |
Hello @joshcangit |
Um actually, the issue is with I updated it by installing under the home directory then copying it over. |
This comment was marked as off-topic.
This comment was marked as off-topic.
My idea is |
This comment was marked as off-topic.
This comment was marked as off-topic.
Using yarn to install npm globally, initially seems to work, but upon closer examination, using a tool like npm-check-updates, reveals that it doesn't completely work as expected. |
This has been fixed in npm/cacache#195, it works now |
Thanks for pointing out, this issue will be closed as completed once we have upgrade to a version of nodejs which comes with this fix for npm. LTS should not be much of a problem, but the latest version will take some time to catch up |
You can try this: |
Not sure if this works. |
That script ain't going to work, you are just replacing the npm binary and the node_modules directory without actually applying the fix which we have in our packaged version of node |
Bro, how about if you personally check the functionality of the script? |
This script does the same job as
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This seems to have gone off topic. The name has nothing to do with the functionality. Nor does bickering about a script. For me, the patched npm was available in a nodejs update in my Termux some time ago. At some later time, npm was independently updated upstream somewhere, so that the version installed was out of date. If some people are still having a bug, then let them please continue to explore that here. To troubleshoot, I think it might be reasonable to uninstall nodejs then verify the old npm is truly gone, then reinstall nodejs and verify it has the patched npm. Then wait for a new npm to be released upstream, and try to self-update. Only people still kbserving the initial problem should be posting here. Otherwise, if others confirm this is now working and nobody reports errors, close this. Probably any other bug is a new bug and deserves a new issue. Thanks to all who got this working for us. |
|
nodejs-lts has nodejs v18.16.1 and npm v9.5.1. The fix landed in cacache v17.0.7. npm v9.5.1 is using cacahe v17.0.4. cacache v17.0.7 doesn't land in npm until npm v9.6.6, which doesn't land in node until node v18.17.0, which is the very next release after node v18.16.1. Can nodejs-lts simply be bumped up to v18.17.0 to fix npm self-updates? |
Now when I uninstall nodejs-lts and reinstall nodejs which has the upstream-fixed npm v9.6.6, I can't upgrade because the outdated Termux patch which references this issue 13293 is still applied. (Edit: I may have previously upgraded using yarn but then forgot. See workaround below.) So 2 things:
As a workaround, use yarn or possibly another package manager (pnpm gave me a problem which I've not yet diagnosed), to install npm globally. |
It happened to me, I was wondering why it worked at first, but not on reinstallation, but I used |
This should hopefully silence people complaining of unable to update but npm is showing an update being available. Closes termux#13293
Again, I have been bypassing this ridiculous limitation for over a year with no ill effects. The upstream bug which initially triggered this problem has long since been fixed, as noted above, though stubborn illiteracy prevails here. The ostrich fix here, to not check for updates and pretend they don't exist, and keep applying a patch for a problem that no longer exists, is beyond silly. If it's broken, prove it's broken with a specific test, not assume it's broken because it broke a few years ago. |
Please help out am facing this error: "/data/data/com.termux/files/usr/lib/node_modules/node-gyp/bin/node-gyp.js" has bad ELF magic: 23212f75 npm error A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2024-08-31T16_01_42_647Z-debug-0.log |
I'm getting this error on the version 9.1.2 of npm:
As I don't have root , I can't solve it with what is indicated in the log
This happens with anything I try, like
The text was updated successfully, but these errors were encountered: