移除口香糖并重新开始

时间:2018-11-22 18:00:54

标签: node.js npm gulp

两年前,我有一个旧项目正在尝试更新。此时,我想从我的机器上完全删除gulp,并从npm install --global gulp-cli版本4的新指南重新开始,但是出现以下错误:

npm ERR! code EEXIST
npm ERR! Refusing to delete /Users/danale/.npm-global/share/man/man1/gulp.1: ../../../lib/node_modules/gulp/gulp.1 symlink target is not controlled by npm /Users/danale/.npm-global/share/man/man1
npm ERR! File exists: /Users/danale/.npm-global/share/man/man1/gulp.1
npm ERR! Move it away, and try again.

我尝试过rm -rf node_modules/,然后尝试npm install gulp-cli -g,然后返回错误。需要删除的文件在这里0 lrwxr-xr-x 1 danale admin 36 Aug 18 2017 gulp -> ../lib/node_modules/gulp/bin/gulp.js

我尝试过$ rm ~/lib/node_modules/gulp/bin/gulp.js rm: /Users/danale/lib/node_modules/gulp/bin/gulp.js: No such file or directory

我仍然无法删除它。如何从Mac OSX中完全删除gulp,然后根据当前的gulp文档重新开始?

1 个答案:

答案 0 :(得分:1)

当我删除文件时,看起来像这样工作:

rm /Users/danale/.npm-global/share/man/man1/gulp.1,然后尝试:

$ npm install --global gulp-cli
/Users/danale/.npm-global/bin/gulp -> /Users/danale/.npm-global/lib/node_modules/gulp-cli/bin/gulp.js
+ gulp-cli@2.0.1
added 235 packages from 148 contributors in 3.038s