Skip to content

Instantly share code, notes, and snippets.

@jzwinck
Created February 2, 2013 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzwinck/4695723 to your computer and use it in GitHub Desktop.
Save jzwinck/4695723 to your computer and use it in GitHub Desktop.
Test case for npm install of a module, then something that depends on it, then remove the first and try to fix up the second. It doesn't work well as of this writing (node.js 0.8.18).
#!/bin/bash -eux
cat <<EOF >package.json
{
"name": "npm-install-order-test",
"private": true,
"version": "0.0.0",
"dependencies" : {
"express" : "*"
}
}
EOF
npm install connect # first, explicitly install an indirect dependency
npm install # should install express, but won't install connect again
rm -r node_modules/connect # changed our mind, remove the connect we installed
npm install # should recognize that express is now missing a dependency
# now we have a non-working installation of express
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment