Is there a way to config npm not to install package using a lazy version like:
"coffee-script": "^1.11.1",
But
"coffee-script": "1.11.1",
And have this behavior become the default one? We usually don't want to use lazy versions, I prefer to manually upgrade everything to the latest from time to time rather than having a bug thrown up at my face after a new deployment due to a bug in one of my dependencies.
The only way to "do that" right now is to manually remove the ^
character every time after every npm install
, which is a bit boring.
Run npm update -g npm. Execute this command by running the command prompt as Administrator npm install -g windows-build-tools. Run npm install inside the project folder where the package. json file is located, if it doesn't work run: npm install --force.
You can downgrade the npm version by specifying a version in the related commands. If you want to downgrade npm to a specific version, you can use the following command: npm install -g npm@[version.
NPM: Install Specific Version of a Package.
This is the command that will set a user variable in your npm configuration to always default to use the exact version when performing an npm installation of all packages.
Enter this command in your terminal:
npm config set save-exact=true
The new preference is stored in a user-based custom npm configuration file. It is located here:
~/.npmrc
Finally, you can verify the setting was saved with the command:
npm config ls
Official NPM docs here:
https://docs.npmjs.com/misc/config
https://docs.npmjs.com/files/npmrc
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