Conversation
add node 10 and 11; use `nvm install-latest-npm`; fix install script so it works on older nodes; cache nvm dir
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' | ||
- 'nvm install-latest-npm' | ||
install: | ||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain what each segment in the before_install
and install
does, as my travis/bash cripts are nowhere near as gooda as yours it seems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because the latest npm version that 0.6 and 0.9 support, doesn't support scoped modules, so it uses node 0.8 to install them and then switches back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaning towards this being another awesome-travis script as it conflicts with the existing node-install
and node-upgrade-npm
functionality.
Would be nice for these two parts to become their own scripts for easy embedding/combination with other awesome-travis scripts.
I can make the necessary alterations upon feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this line; it just means any package with scoped deps won’t be able to successfully install on 0.6.
I’m confused what conflicts tho, since it’s using nvm already inside Travis.
- linux | ||
before_install: | ||
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' | ||
- 'nvm install-latest-npm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this installs the latest supported version of npm for the current node version, with logic that is far more accurate than anything else in the ecosystem :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this functionality should go into the node-upgrade-npm
script or become another script — not sure how their functionality differs.
The code inside this snippet should allow easy embedding of the various awesome-travis scripts.
I can make the necessary alterations upon feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logic is baked into nvm; it’s not a simple mapping (it’s multi step) and i keep it up to date as npm releases new versions. tbh I’d just replace that entire upgrade npm script with this nvm command, since it’s always available in Travis.
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' | ||
- 'nvm install-latest-npm' | ||
install: | ||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because the latest npm version that 0.6 and 0.9 support, doesn't support scoped modules, so it uses node 0.8 to install them and then switches back.
Ok merged, will extract the scripts out, so they are more plug-n-play with the rest of the scripts. |
Ok all done. I replaced |
add node 10 and 11; use
nvm install-latest-npm
; fix install script so it works on older nodes; cache nvm dir