I have a package.json file like below:-
{
"name": "app",
"version": "0.0.1",
},
"scripts": {
},
"lint-staged": {
"client/**/*.{js,jsx}": [
"prettier --ignore-unknown --write",
"npm run fix:js:lint"
]
},
"dependencies": {
"@neha/testapp": "0.0.80",
"date-fns": "^2.0.0-alpha.27",,
"react": "^17.0.2",
"react-datepicker": "^2.8.0",
"react-dom": "^17.0.2",
"react-draggable": "^4.4.3",
"react-hot-loader": "^4.13.0",
"react-markdown": "^5.0.2",
"react-redux": "^7.1.3",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2"
},
}
I want to change the version of @neha/testapp
under dependencies
to something like this by PACKAGE_VERSION
variable
"@neha/testapp": "0.0.80-test"
I tried this so far to reach the nested key but could only reach version
sed -i '/version/s/[^.]*$/'"${PACKAGE_VERSION}\"/" package.json