Run npm list to find out what you have installed. Run npm shrinkwrap to build the npm-shrinkwrap.json , which you can use as a source link to create the correct package.json . My workflow should always update package.json and then run npm install . I never ran npm install foo to get some kind of package, because it creates the risk of forgetting to add it to package.json , and then not launching the application upon deployment.
Updated to add . I am currently running npm install --save foo or npm install --save-dev foo , as I have now decided that the version numbers ~0.4.3 that it adds to package.json are better than my previous preference 0.4.x since ~ gives you a more accurate minimum version number.
source share