In my application I have installed few node modules using below command
npm install <modulename>
I forgot to mention "--save" to save the dependency list to package.json file.
Now I would like to update those dependencies in package.json file without updating the file manually . Any idea how it can be done ?
json Of course, you can also simply edit the package. json file directly. Remember to run rush update afterwards to update the shrinkwrap file.
For updating a new and major version of the packages, you must install the npm-check-updates package globally. It will display the new dependencies in the current directory whereas running this command will list all the global packages which have new releases.
Just do: npm i name_of_package -S
or the long version: npm install package_name --save
If you need to save it as a dev dependency, use the -D flag
You can run the same command again, specifying --save
flag and it will be automatically included in package.json
. The only problem is that the version of the package can be updated to newer version, so you may specify the specific version of your app: npm i --save [email protected]
.
Alternatively you can modify package.json
yourself to include the dependency:
"dependencies": {
"module": "*"
}
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