在cmd上无法安装webpack:Refusing to delete....cmd: is outside ......not a link

Refusing to delete D:\node.js\node_global\node_modules\webpack\node_modules.bin\acorn.cmd: is outside D:\node.js\node_global\node_modules\webpack\node_modules\acorn and not a link
等等类似的错误无法删除错误,请查看你的node.js里面的是否有关webpack残留文件(报错中会有显示路径),可以先进行复制后(防止万一无法解决好恢复),直接删除后,从新输入npm install webpack@3.6.0 -g

我的cmd的错误结果

C:\WINDOWS\system32>npm install webpack@3.6.0 -g
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! path D:\node.js\node_global\node_modules\webpack\node_modules\.bin\mkdirp.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete D:\node.js\node_global\node_modules\webpack\node_modules\.bin\mkdirp.cmd: is outside D:\node.js\node_global\node_modules\webpack\node_modules\mkdirp and not a link
npm ERR! File exists: D:\node.js\node_global\node_modules\webpack\node_modules\.bin\mkdirp.cmd
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\node.js\node_cache\_logs\2020-02-28T15_04_55_339Z-debug.log

解决办法 删除文件

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值