In a react-native project, there is mocha (9.2.0)
as a devDependency like the following –
react-native-svg –
"dependencies": {
"css-select": "^5.1.0",
"css-tree": "^1.1.3"
}
css-tree –
"devDependencies": {
...
"mocha": "9.2.0",
...
}
When I perform the app bundle, I found the mocha
is there.
Now I want to upgrade the mocha
version to 10.1.0
. I can do that by modifying the package-lock.json
. But is it possible to do the same without modifying the package-lock.json
by using the npm override
or resolution
or something similar to that?
2
Answers
You can try this command but it will still update your package.json ultimately
you can use patch-package https://github.com/ds300/patch-package, modify dependencies in
node_modules
and then patch it withnpx patch-package css-tree
or what package do you want to fix.