Let's say my package.json
looks like this:
{
"name": "cool_project",
"version": "0.0.0",
"scripts": {
"start": "node index.js"
},
"private": true,
"dependencies": {
"rxjs": "^6.0.0"
}
}
And then after running npm install
the version of rxjs
version is 6.6.0
.
npm ls rxjs
`-- rxjs@6.6.0
Is there an npm
or yarn
command I can now run to pin the version inside my package.json
to the version installed?
{
"name": "cool_project",
"version": "0.0.0",
"scripts": {
"start": "node index.js"
},
"private": true,
"dependencies": {
"rxjs": "6.6.0"
}
}
This is useful for me because if I want to check what package versions I'm on, I can easily see it directly inside of package.json
and commit it to my git repo history.