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

Fix underscore.string dependency #886

Closed
wants to merge 1 commit into from
Closed

Fix underscore.string dependency #886

wants to merge 1 commit into from

Conversation

adrianheine
Copy link
Contributor

According to the npm registry, there is no underscore.string@2.2.0rc, instead the version is 2.2.0-rc.

According to the [npm registry], there is no `underscore.string@2.2.0rc`, instead the version is `2.2.0-rc`.

[npm registry] http://registry.npmjs.org/underscore.string
@shama
Copy link
Member

shama commented Sep 1, 2013

Thanks! But we have the deps versioned with a prepended ~ meaning it will install the latest patch version. For underscore.string that will be 2.2.1 and so this isn't an issue.

@shama shama closed this Sep 1, 2013
@adrianheine
Copy link
Contributor Author

@shama AFAIK that’s not the case, because in 2.2.0rc, the rc is not considered a patch version. At least my npm v1.2.18 with semver 2.1.0 thinks so.

@shama
Copy link
Member

shama commented Sep 1, 2013

What error are you getting? and which version of node.js are you running?

@adrianheine
Copy link
Contributor Author

I’m running 0.10.17. When I just do npm install grunt, I get grunt@0.4.1 with underscore.string@2.2.0-rc. However, when I do the following:

git clone https://github.com/gruntjs/grunt.git grunt-master
mkdir node_modules
npm install ./grunt-master

I get this error:

npm ERR! Error: No compatible version found: underscore.string@'~2.2.0rc'
npm ERR! Valid install targets:
npm ERR! ["0.9.2","1.0.0","1.1.3","1.1.4","1.1.5","1.1.6","2.0.0","2.1.0","2.1.1","2.3.0","2.3.1","2.3.2","2.2.1","2.2.0-rc","2.3.3"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:685:10)
npm ERR!     at /usr/share/npm/lib/cache.js:607:10
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR!     at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /tmp/grunt/npm-debug.log npm

npm ERR! System Linux 3.10-2-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "./grunt-master"
npm ERR! cwd /tmp/grunt
npm ERR! node -v v0.10.17
npm ERR! npm -v 1.2.18
npm http 304 https://registry.npmjs.org/lodash
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /tmp/grunt/npm-debug.log
npm ERR! not ok code 0

@shama
Copy link
Member

shama commented Sep 1, 2013

@adrianlang Try npm cache clean first. Here is what I get when I:

git clone git://github.com/gruntjs/grunt
cd grunt
npm install
underscore.string@2.2.1 node_modules/underscore.string

I also get 2.1.1 when I npm install grunt into another project.

@adrianheine
Copy link
Contributor Author

npm cache clean does not change anything for my previous code sample, nor for your command sequence.

@shama
Copy link
Member

shama commented Sep 1, 2013

I wonder if it's because your npm is at 1.2.18. Could you upgrade to the latest with npm update npm -g?

@nschonni
Copy link

nschonni commented Sep 1, 2013

That is odd, 0.10.17 shipped with npm 1.3.8

@adrianheine
Copy link
Contributor Author

@nschonni @shama I’m using the debian sid packages for both, that’s why my npm version is a bit odd.

However, I don’t think it actually matters too much which odd versions I use and which odd steps I take in order to reproduce the problem: Semantic Versioning clearly states that pre-release versions are denoted by appending a hyphen and the pre-release identifier. The format used in package.json is not conformant, and it differs from what the version is actually called in underscore.string itself, so I see no reason to keep it as it is.

@shama
Copy link
Member

shama commented Sep 2, 2013

@adrianlang It does matter though. If an issue is occurring through normal installation then it is a bug and we should do a patch fix for it. If it only occurs when a user sets up an abnormal configuration then we'd advise the user not to do that.

The version of underscore.string used to be valid in npm and is why it is labeled in that way. In all the ways I've tried, I have not been able to duplicate the error. Prepending ~ means install the latest patch version which npm seems to successfully do in each instance I've tried.

@cowboy Do you think this merits a patch fix?

@nschonni
Copy link

nschonni commented Sep 2, 2013

2.2.0rc is the name of the git tag https://github.com/epeli/underscore.string/tree/v.2.2.0rc

@cowboy
Copy link
Member

cowboy commented Sep 2, 2013

I'm hesitant to change anything in Grunt at the moment, since everything works just fine with the latest version of npm, which is easy to upgrade to if you happen to be using an older version.

This problem could be addressed by adding npm-specific troubleshooting information into the official docs. It's something I really don't want to do, but people file so many npm-specific issues that it might be worthwhile.

@adrianheine
Copy link
Contributor Author

@nschonni This has nothing to do with git tags.

@cowboy I understand that you are hesitant to change. However, from my point of view, a tiny part of grunt’s package.json violates a standard by just a small bit, and that creates problems for at least one actual person out there (namely me). And I don’t see a factual reason for sticking with the violating version.

@bprosnitz
Copy link

I am also experiencing this issue with 1.2.18. I want to point out that this is the version of npm that will ship with Ubuntu 13.10 LTS later this year, so a large number of people will probably run into this issue in a month or so.

@cecchi
Copy link

cecchi commented Sep 18, 2013

@adrianlang +1

@cowboy I'm also experiencing this issue, and it's pretty frustrating. Seems like a quick fix to update the package.json to specify a better version name. Updating NPM did not fix the problem.

@vladikoff
Copy link
Member

Reopening this for 0.4.2, so we don't forget :)

@vladikoff vladikoff reopened this Sep 18, 2013
@cowboy cowboy closed this in 08a3af5 Sep 18, 2013
@cowboy
Copy link
Member

cowboy commented Sep 18, 2013

@bprosnitz can you test this out by cloning and checking out master and make sure it works for you?

@bprosnitz
Copy link

@cowboy It is hard for me to evaluate the issue as I'm new to node and not sure if I am building it correctly in the branch.

Running 'npm install' in master was failing due to a step where it tried to fetch grunt as a dependency and then ended up hitting the same issue i was seeing before. It seems strange to me that grunt has itself as an indirect dependency. However, since this failed due to the grunt dependency being out of date, I would imagine it might work once a new version of grunt hits the npm repository.

@ptomasroos
Copy link

I'm having this problem on the Ubuntu 13.10 release.

Cloning from master works and then npm install.

When can you release this new package?

@ptomasroos
Copy link

Forgot to say that this is still a problem:

11912 verbose from cache /home/tomas/dev/grunt/node_modules/grunt-contrib-jshint/package.json
11913 info preuninstall grunt-contrib-jshint@0.6.5
11914 info uninstall grunt-contrib-jshint@0.6.5
11915 verbose true,/home/tomas/dev/grunt/node_modules,/home/tomas/dev/grunt/node_modules unbuild grunt-con
trib-jshint@0.6.5
11916 info postuninstall grunt-contrib-jshint@0.6.5
11917 error Error: No compatible version found: underscore.string@'~2.2.0rc'
11917 error Valid install targets:
11917 error ["0.9.2","1.0.0","1.1.3","1.1.4","1.1.5","1.1.6","2.0.0","2.1.0","2.1.1","2.3.0","2.3.1","2.3.
2","2.2.1","2.2.0-rc","2.3.3"]

11922 error node -v v0.10.15
11923 error npm -v 1.2.18

Ubuntu 13.10 LTS

@shama
Copy link
Member

shama commented Nov 6, 2013

@ptomasroos You can fix it now by upgrading npm: npm install npm -g. Ubuntu mistakenly ships with an old version of npm. For node v0.10, npm should be on 1.3.

@ptomasroos
Copy link

I've tried that and it refuses still same version after I run that. :/

Sent from my iPhone

On 6 nov 2013, at 18:28, Kyle ☱☲☳☴☵☷ ☶ Robinson ☱☲ ☳☴☵☶☷ Young notifications@github.com wrote:

@ptomasroos You can fix it now by upgrading npm: npm install npm -g. Ubuntu mistakenly ships with an old version of npm. For node v0.10, npm should be on 1.3.


Reply to this email directly or view it on GitHub.

@ptomasroos
Copy link

Running that on Ubutun 13.10 causes following output.

tomas@tomas-ubuntu:~$ sudo npm install npm -g
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm WARN package.json github-url-from-git@1.1.1 No repository field.
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@1.3.13 /usr/local/lib/node_modules/npm

Running it from that path causes following.

tomas@tomas-ubuntu:~$ node /usr/local/lib/node_modules/npm/bin/npm-cli.js -v
1.3.13

Running it on the regular path still shows old version

tomas@tomas-ubuntu:$ npm -v
1.2.18
tomas@tomas-ubuntu:
$ which npm
/usr/local/bin/npm

So clearly the nodejs / npm package in ubuntu is not pointing to the correct path so that selfupdates can occurr

So I'm still stuck.

@ptomasroos
Copy link

I solved it by skipping the Ubuntu official package and getting the PPA maintained by chris lea instead.

sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

@vladikoff
Copy link
Member

yeap that's the way to go @ptomasroos :)

@taylorterry3
Copy link

Fixed this using @ptomasroos' path on Ubuntu 13.10. Thanks!

@lkesteloot
Copy link

Thanks @ptomasroos . On Ubuntu 13.10 I had to do this instead of the python-software-properties:

sudo apt-get install software-properties-common

@NicholasJallan
Copy link

Fixed this using @ptomasroos' path on Ubuntu 13.10. Thanks!

@gu-fan
Copy link

gu-fan commented Nov 21, 2013

ooops ,me too here
ubuntu 13.10

@Ni0rd
Copy link

Ni0rd commented Nov 21, 2013

Same here, thank you @ptomasroos !

@erinishimoticha
Copy link

Works for me. Thanks, @ptomasroos.

@ghost
Copy link

ghost commented Feb 7, 2014

Fixed this using @ptomasroos' path on Ubuntu 12.04.4 LTS

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

Successfully merging this pull request may close these issues.