I was using gulp on the project, then i decide to deleted all the dev dependencies to switch to webpack, but every time i try to install using npm is get this error:
<
Iam using
-node v15.5.0
-npm v6.14.10
Try this:
example: npm i @react-navigation/native
This will fix the issue.
cache verify command resolved the issue for me
npm cache verify
I just retried to run
npm install
and it succeeded
The second line may give a hint on what's happening:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\fsevents-e80c4ef4\node_modules\are-we-there-yet' -> 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\are-we-there-yet-5db4c798'
It looks like npm doesn't have enough permission on the folder you're trying to use.
You can try:
npm install
with admin permission.If your app is running on npm you may need to stop it before you add or install anything. I had this problem several times. I was running my react native app with expo cli. After closing the expo cli and closing chrome , my problem was fixed.
When I got this error I looked for all running instances of node in my task manager (i use process explorer on windows) and close/kill all running instances of node. For me its often webstorm or vs code. After closing these programs and ensuring there is no running node process npm install works again.