Skip to content

Commit

Permalink
update npm during travis CI run to fix transitive caret (^) dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed May 20, 2014
1 parent 1d7ffe8 commit 4de07c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ language: node_js
node_js:
- 0.8
- '0.10'
before_install:
- 'npm install npm -g'
notifications:
email: false

12 comments on commit 4de07c0

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious if this works. I've seen reports of glob borking in older Node versions on Travis-CI today because it updated a dep with the caret. Travis-CI updated their npm recently to support carets.

@michaelficarra Were you getting test issues? They seem all green https://travis-ci.org/jashkenas/underscore/builds. Was the wrong dep versions being pulled down?

@michaelficarra
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I know is the 0.8 build was failing on my #1616 branch (optionator is specified using a caret in eslint's dependencies) and then I did this and it stopped failing.

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the related travis-ci issue where they updated npm:
travis-ci/travis-ci#2076

@michaelficarra
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdalton: You have to look under the pull requests tab. There you'll see build 907.1 failed, but build 909.1 passed, the only change being rebasing off this commit.

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found the issue. It's Travis-CI, before they used to use their npm 1.4.3 for old and new versions of Node. But today they switched to special casing the npm version per node version. So the npm associated with Node 0.8 is older than the one associated with Node 0.10.

@michaelficarra
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation?

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open a travis-ci run from a day or two ago. Look at the npm version in the log for a Node 0.8 run. Then look at it on todays run (the failing one). You'll see the versions are different.

Your patch forces npm to be updated regardless of Node version, avoiding Travis' older default versions now.

Travis-CI will periodically update things like Node and npm versions. I had to recently lock down a 0.11 version for --harmony tests with Istanbul because they updated to a newer point release causing errors.

@dougwilson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdalton

Here is a build from 2 days ago: https://travis-ci.org/senchalabs/connect/jobs/25410317

It was using npm version 1.2.30.

Here is a build from today: https://travis-ci.org/senchalabs/connect/jobs/25593611

It is using npm 1.2.30.

I have never seen the node.js 0.8 build on Travis CI not using 1.2.30 for a long, long time.

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dougwilson
Hmm interesting. Here's mine from a day ago. Notice the

node --version
v0.10.28
$ npm --version
1.4.9
$ nvm use 0.8
Now using node v0.8.26

And a more recent run:

nvm use 0.8
Now using node v0.8.26
$ node --version
v0.8.26
$ npm --version
1.2.30

@dougwilson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between those is one is using node v0.10.28 and the other node v0.8.26 (i.e. the reason they are using different npm versions is the node.js version, not the date).

Node v0.8.26 uses npm 1.2.30 and node v0.10.28 uses npm 1.4.9. It has been like that for a long time.

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were both specified as Node 0.8 in the travis.yml and you see eventually they both get to using v0.8.26, it's just one is using a newer npm. I didn't specify that. So that's the trail I followed.

@dougwilson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see now. nvm use 0.8 is invoked in your first one after it printed the npm version, so the npm was the v0.10 one, not the v0.8 one. Since it didn't call npm --version after the nvm use 0.8 it's hard to know what the npm version was actually using in that build :(

Please sign in to comment.