I already have a global node_modules folder in /usr/local/lib/node_modules, but I just found there is also a ~/node_modules folder under my home folder. Can I delete this one?
I execute node -e "console.log(global.module.paths)"
and I get:
[ '/Users/Username/node_modules',
'/Users/node_modules',
'/node_modules' ]
And if I delete the node_modules folder, which is under the home directory, then I execute npm list @vue/cli-ui
. It would should this error:
/Users/Username
└── UNMET DEPENDENCY @vue/[email protected]
npm ERR! missing: @vue/[email protected], required by Username
So, can I delete the node_modules folder under my home directory? What's the use of it? Or should I need reinstall Node.js and npm?
And if I do delete this folder, when I execute npm ls
, I would get these errors:
/Users/Username
├─┬ UNMET DEPENDENCY @vue/[email protected]
│ ├─┬ UNMET DEPENDENCY @akryum/[email protected]
│ │ └── UNMET DEPENDENCY [email protected]
│ ├─┬ UNMET DEPENDENCY @vue/[email protected]
│ │ ├── UNMET DEPENDENCY [email protected]
│ │ ├── UNMET DEPENDENCY [email protected]
│ │ ├─┬ UNMET DEPENDENCY [email protected]
│ │ │ ├── UNMET DEPENDENCY [email protected]
How can I solve this problem?
Now everything is OK after executing npm cache verify
.