2

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.

enter image description here

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?

1
  • Why don't use override? Commented Dec 8, 2022 at 8:37

2 Answers 2

1

you can use patch-package https://github.com/ds300/patch-package, modify dependencies in node_modules and then patch it with npx patch-package css-tree or what package do you want to fix.

0

You can try this command but it will still update your package.json ultimately

npm install [email protected] --save --only=dev

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.