在卸载自耕农和自耕农发电机后,npm一直在抱怨

时间:2016-01-24 21:45:06

标签: npm yeoman

我卸载了自耕农和两个自制发电机:

sudo npm uninstall yeoman -g
sudo npm uninstall generator-angular -g
sudo npm uninstall generator-karma -g

但是现在当我列出当前安装的软件包时,npm一直在抱怨它无法找到自己或那些生成器......(这是对的,我只是卸载了它们......)

当我运行npm update时,它们甚至会被重新安装!哎呀!为什么!

npm ls -g --depth=0

/usr/local/lib
├── bower@1.7.1
├── browserify@12.0.1
├── express-generator@4.13.1
├──  error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/generator-angular/package.json
├──  error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/generator-karma/package.json
├── grunt-cli@0.1.13
├── npm@3.5.3
├── typescript@1.7.5
└──  error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/yo/package.json

还有很多错误(不会在这里发布),从

开始
npm ERR! error in /usr/local/lib/node_modules/generator-angular: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/generator-angular/package.json'
npm ERR! extraneous: wiredep /usr/local/lib/node_modules/generator-angular/node_modules/wiredep

1 个答案:

答案 0 :(得分:0)

您是否尝试清理npm缓存?试试这个:

1. cd to your npm directory (/usr/local/lib/node_modules, I guess)
2. sudo rm -rf ~/.npm
3. sudo npm cache clean