addLocal Could not install node_modules\cordova-plugin-badge

I got the code from git and then try to run npm i then I got this issue. Could you tell me why? This works really well before today. I don t know why this? I cannot run npm i. Do you know why? This is an ionic 3 project. ver: 3.9.2

D:\Tracker\renoTracker>npm i npm ERR! addLocal Could not install D:\Tracker\renoTracker\node_modules\cordova-plugin-badge npm WARN deprecated cordova-plugin-console@1.1.0: This plugin has been deprecated since it is now included in the latest versions of cordova-ios npm WARN deprecated highcharts-more@0.1.2: this package has been deprecated, just import modules from the highcharts folder npm ERR! Windows_NT 6.3.9600 npm ERR! argv “C:\Program Files (x86)\nodejs\node.exe” “C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js” “i” npm ERR! node v6.10.0 npm ERR! npm v3.10.10 npm ERR! path D:\Tracker\renoTracker\node_modules\cordova-plugin-badge npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open ‘D:\Tracker\renoTracker\node_modules\cordova-plugin-badge’ npm ERR! enoent ENOENT: no such file or directory, open ‘D:\Tracker\renoTracker\node_modules\cordova-plugin-badge’ npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent

npm ERR! Please include the following file with any support request: npm ERR!

Error message sound like something is messing with your files. New anti virus scanner?

One solution that could help:
Your problem is probably with npm, something to do with permissions and files. This happens quite often and is almost impossible to successfully debug (at least here in the forum).

One solution: Uninstall your node, install nvm (or nvm-windows if you are on Windows), install a new node (which includes npm) with this, then install ionic and cordova again and try your command again. The problem should be gone.

Thanks a lot for the advice. I have created a new ionic 3 project and there npm i worked. Do you have any clue about such behavior? Hope if I have any issue with node or npm then that too failed no?

Then my guess would be something with how packages or plugins were installed in this project. Something is amiss here. Maybe try deleting node_modules and run npm install again. It’s very hard to debug such problems :confused:

1 Like

Yes, You’re right. Actually, this happened after I have deleted the node_modules folder and then run the npm i. So after that, I have restored it using recycle bin and then npm i worked. Really strange :frowning: I don’t know what should I do when there will be ionic version change or like that? Because on such use cases we need to delete the node_modules folder and use npm i no?

You will have to find out what is going on on your machine - updates and even just checking out the project on another computer will definitely need working npm i.

Ok sure. I’ll see that. Thanks a lot for your great advice :slight_smile: