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

Cannot use npm newer than 1.4.12 #65

Closed
martin-g opened this issue Jun 27, 2014 · 21 comments · Fixed by #75
Closed

Cannot use npm newer than 1.4.12 #65

martin-g opened this issue Jun 27, 2014 · 21 comments · Fixed by #75

Comments

@martin-g
Copy link

It seems there is some problem with installing npm 1.4.13 and newer.
I use pretty much the same pom.xml as the linked sample project in the README and
using <npmVersion>1.4.12</npmVersion> works but <npmVersion>1.4.13</npmVersion>. According to npm info npm and http://registry.npmjs.org/npm/ the latest version is 1.4.16.

Is it something related to the fact that npm is distributed with node.js since a while ?
If so then please either update the README and/or do not require npmVersion for newer node.js.

Thanks for this nice plugin!

@eratzlaff
Copy link

I took a look on how to solve this issue and I thing one solution would use the npm version from the nodejs tar file if you omit the <npmVersion> and make it optional.
For example, for node.js version 0.10.29 you get npm version 1.4.14.
Lets see what @eirslett say.

@eirslett
Copy link
Owner

That's an option for Linux and OSX, but the Windows binary is still not bundled with npm. I'm aware that npm is already bundled with the other two, but to keep the plugin simple I opted to download npm separately on all platforms. That also allows you to use a different version of npm than what the version of Node.js "recommends" (though that's probably an edge case)

@eratzlaff
Copy link

I still think you can make the optional.
That way every one would choose his prefered version.
You could use the npm version bundled with the linux tar file for example if you omit the <npmVersion>.

@martin-g
Copy link
Author

Detecting that this is a Unix machine and extracting the version of the embedded npm would be the best.
My main issue is that I cannot use any newer version of npm. 1.4.13+ just fails with 404-like error.

@eirslett
Copy link
Owner

Looks like 1.4.12 is the latest npm version released at http://nodejs.org/dist.
In fact, it isn't coupled with any of the node.js versions:
http://nodejs.org/dist/npm-versions.txt
I guess they will have 1.4.13 (or newer) out there as soon as node.js is released. Is there a special feature/bugfix you need or is it just to have the newest version of npm?

@martin-g
Copy link
Author

martin-g commented Jul 1, 2014

No. I don't need the newest version.
1.4.12 is good enough for me.
I just used npm info npm to find which is the latest version and 1.4.12 was the first that worked.

@eirslett eirslett closed this as completed Jul 3, 2014
@lfryc
Copy link
Contributor

lfryc commented Jul 31, 2014

Hey guys, I found out that I required NPM 1.4.14 in order to use new project-specific .npmrc configuration file. This issue is a blocker in such a case.

@lfryc
Copy link
Contributor

lfryc commented Jul 31, 2014

@eirslett would you mind to reopen this issue as it seems nothing have changed with the situation on http://nodejs.org/dist/npm/ ?

@lfryc
Copy link
Contributor

lfryc commented Jul 31, 2014

Ah, my bad, this support was added in npm/npm@1707fce in 1.4.11 (but both 1.4.11 and 1.4.12 doesn't work in my project).

Still, I consider this issue a blocker for progress as newer NPM versions are released.

@eirslett eirslett reopened this Jul 31, 2014
@eirslett
Copy link
Owner

Is this just the Node.js team being lazy for not uploading releases to nodejs.org/dist, or have they officially changed the layout there?

@lfryc
Copy link
Contributor

lfryc commented Aug 1, 2014

A question posted to Nodejs forums: https://groups.google.com/forum/#!topic/nodejs/sde0nVCtWLo

@bkonkle
Copy link

bkonkle commented Aug 12, 2014

If you look at the install script, apparently the individual npm tarball is now being hosted just on the npmjs.org registry server.

Here's what the url structure looks like: https://registry.npmjs.org/npm/-/npm-1.4.23.tgz

@lfryc
Copy link
Contributor

lfryc commented Aug 13, 2014

Awesome, thanks for the information @bkonkle

Good news is that registry.npmjs.org contains also historical NPM versions.

The comparison of the structure of tarballs from both sources shows that there are same but the top-folder (in on case it is npm and in other it is package):

nodejs.org/dist/npm: npm-1.4.12.tgz:/npm/cli.js
registry.npmjs.org: npm-1.4.12.tgz:/package/cli.js

I assume we can switch to the new registry.npmjs.org in new versions of frontend-maven-plugin without compatibility issues.

I just suggest we introduce npmDownloadRoot side by side existing downloadRoot (should it be renamed to nodeDownloadRoot?).

@eirslett
Copy link
Owner

Aah, I see. The solution would then, as @lfryc suggests, to rename downloadRoot to nodeDownloadRoot and make a new setting, npmDownloadRoot. PR would be great!

@lfryc
Copy link
Contributor

lfryc commented Aug 13, 2014

I'm on it

@prashathsenthil
Copy link

Can some please post the solution steps for this issue? I too face the same issue i.e. having older npm version in POM.xml (v0.10.18;1.3.8) if i try to update the version of node and npm in POM.xml and run "maven install" then i could see issues in the log stating that it cannot download the latest npm version and the server throws 404..... the installation is happening behind a proxy, not sure if that's an issue because the node version 0.12.0 is getting installed properly but npm is not getting installed or downloaded. Kind of stuck because of this...

@bkonkle
Copy link

bkonkle commented May 6, 2015

What version of the frontend-maven-plugin are you using? I'm installing Node 2.9.0 with this and having no trouble now.

@prashathsenthil
Copy link

@bkonkle i'm using 0.0.15 version of the frontend-maven-plugin and also i hope you are using NPM 2.9.0... Do you think upgrading the version to 0.0.23 or to the latest version of this plugin would resolve the issue.. i.e. after updating the plugin to latest version and then as a next step updating the npm version...

@bkonkle
Copy link

bkonkle commented May 6, 2015

Ha - yes, npm 2.9.0. Updating to 0.0.23 would almost certainly resolve your issue. 0.0.15 is pretty old, and definitely prior to the fix discussed here.

@prashathsenthil
Copy link

@bkonkle i have updated the plugin version to 0.0.23 and node version to 0.12.2 and npm version to 2.9.0. It is working as expected when i run mvn install in local. But if the task runs in jenkins DEV box there are errors related to npm-cli.js... i tried even wiping out the workspace completely but no luck still the npm-cli error is thrown in the logs,

[ERROR] npm ERR! argv "....Application/client/node/node" "....Application/client/node/npm/bin/npm-cli.js" "install" "--color=false" "--proxy=http://http.proxy.xxxxx.com:8000"
[ERROR] npm ERR! node v0.12.2
[ERROR] npm ERR! npm v2.9.0
[ERROR]
[ERROR] npm ERR! Uncaught, unspecified "error" event.
[ERROR] npm ERR!
[ERROR] npm ERR! If you need help, you may report this error at:
[ERROR] npm ERR! https://github.com/npm/npm/issues
[ERROR] npm ERR! Linux 2.6.32-431.el6.x86_64

@bkonkle
Copy link

bkonkle commented May 6, 2015

It's possible that you're getting hit with the same spaces-in-path issue as I am. Jenkins uses workspace paths that can easily have spaces in them, and the default argument parsing doesn't take that into account well. Take a look at my pull request - you may be able to fork the project like I did and use a custom version of it to fix the spaces until Eirik has a chance to look at it.

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

Successfully merging a pull request may close this issue.

6 participants