简体   繁体   中英

Why does NPM install an empty "etc" folder and multiple command files?

For some reason, whenever I update or install a package in my project, NPM installs an empty etc folder and multiple .cmd files (see pic down below). It also doesn't update my package.json anymore, I have to manually update the version of the package NPM has updated.

The only thing I can remember that I changed, is adding the nodejs folder as a windows environment variable to access a global command. Other than that, I can't seem to remember doing anything that would allow NPM to do this weird behavior.

Anyone an idea what I might've done wrong? How can I fix this?

Thank you!

Update: I've noticed that adding the empty etc folder happens with each npm action. (npm install, publish, start, update, ..)

npm添加cmd文件和空etc文件夹的奇怪行为

I solved it, but don't really understand how.

After a long search, I discovered all the above files are actually supposed to be in a .bin folder inside the node_modules. I uninstalled and reinstalled nodejs, didn't work.

In the end, I went to the folder where NPM stores its global files: C:\\Users\\username\\AppData\\Roaming\\npm and emptied the folder. Now I can install, update or do any other action with NPM without the above result.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM