-
Notifications
You must be signed in to change notification settings - Fork 3k
NPM 5.4.0 errors on NodeJS 4.2.6 #18395
Comments
A google search suggests that the Buffer.alloc API was introduced in a later version of NodeJS (4.5.0). However the readme suggests that NPM 5.4.0 should work with NodeJS 4 or higher:
Therefor I believe this is a regression (everything worked fine in v5.3.0) and/or a case of outdated documentation. |
Hmm, yeah, looks like |
Ah, I see. What I don't understand is the package.json of tar contains the Node.js >=4.5 requirement:
But NPM doesn't warn me about this when I upgrade NPM to version 5.4.0 (using
Does NPM only warn about engine requirements of the package you're installing, not of its dependencies? |
@nicwortel Hmm, how about?:
|
I experienced the same issue today (on Ubuntu 16.04) I managed to fix it (hope this helps you too) by doing the following: Update nodejs to latest version:
Install latest version of nodejs via apt get
Result
NPM now works!
NO MORE OF THIS!!
|
@kenany yes I did see the warning with the In the meantime I fixed the issue by upgrading NPM to a newer version, as per @goneglobal's suggestion. |
@nicwortel All right. Just curious, what's the output of |
This is a stopgap for build failures described in npm/npm#18395.
This is a stopgap for build failures described in npm/npm#18395.
@goneglobal how did you installed nodejs in version v6.11.2? I am still getting 4.2.6 following your steps... but this instructions with using NVM seems working https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04 |
It's |
I observe this behaviour with node 4.5.1 and npm 4.5.1, so unless my set-up is especially strange (there's scope in the stacktrace for mixed versions, given that only some of the lines have an absolute path) there's a flaw there too: 0 info it worked if it ends with ok |
npm supports the latest Node.js v4, which is v4.8.4. |
@iarna I think the readme should be a bit more explicit about this requirement, right now it says:
Which does not cover it has to be the latest v4, also due to LTS vs. non-LTS support periods node v5 is not supported, even though it fits |
We officially support the latest version of Node.js in all of it's LTS branches. (We don't have the resources to work around every bug in every point release of node any more than the Node.js project does. There are 72 of those currently, for reference.) Now, I wouldn't be opposed to patching But it turns out that it isn't enough. Indeed, npm doesn't run under the first releases of Node v4 that introduce This bug was fixed in I will be introducing new unsupported version messaging that will hopefully be more helpful than what we've had previously. The way that works is if you try to run npm under an older version of npm@4 you'll get:
I'll also write up a clarifying blog post discussing what versions of Node.js we support. As I don't think there's anything further we can do on this issue I'm going to close it, but please feel free to reach out if you think further discussion is warrented. |
I try to upgrade nodejs over 4.7.0 in ubuntu, How could I upgrade nodejs ?
|
The following should do the trick:
(cd /usr/local && sudo wget -O- https://nodejs.org/dist/v4.8.4/node-v4.8.4-linux-x64.tar.gz | sudo tar --strip-components=1 -xzf -)
(cd /usr/local && sudo wget -O- https://nodejs.org/dist/v4.7.0/node-v4.7.0-linux-x64.tar.gz | sudo tar --strip-components=1 -xzf -) v4.8.4 is the latest version of node v4. Remember to uninstall nodejs first. sudo apt-get remove nodejs |
i have did all the methods above but i cant update the version from v4.2.6 help me to fix |
I'm opening this issue because:
What's going wrong?
npm install
shows:npm-debug.log contents:
How can the CLI team reproduce the problem?
Run
npm install
on NPM v5.4.0 on NodeJS v4.2.6 (the default version in the Ubuntu repositories).supporting information:
npm -v
prints: 5.4.0node -v
prints: v4.2.6npm config get registry
prints: https://registry.npmjs.org/The text was updated successfully, but these errors were encountered: