I often move between computers when developing things. With npm and my package.json
it means, or so I thought, everything would be the same when checked out. At least on the same major version ~4.0.0
or example.
However on my fast PC at work I get compile times of 11s compared to, at home, 1.2s.
I'd like to save out npm list
to file so I can run a compare at home.
npm list --save npmlist.txt //for example
If you have problems with npm shrinkwrap
, on windows you can use this:
npm list -json > npmlist.json
And for global packages
npm list -json -g > npmlist.json
You can use npm shrinkwrap
to generate a npm-shrinkwrap.json
file. This file contains the exact versions of npm modules you have installed at that moment, recursively (so also modules of modules and so on). As long as that file sits in the root of your project, running npm install
will install exactly those versions.
You can generate one on either pc to compare, or commit/copy the version generated on one pc to install the same versions of npm modules on the other.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With