运行npm安装wepy2踩坑error EEXIST 问题

时间:2024-01-26 17:28:42

运行npm安装wepy2踩坑error EEXIST 问题

windows 10安装wepy2

以前用过wepy1,现在要学习wepy2,运行以下命令出错

npm install @wepy/cli -g # 全局安装 WePY CLI 工具

 

打开log文件,与cmd界面提示一致,提示错误如下:

11758 error code EEXIST

11759 error path C:\Users\my\AppData\Roaming\npm\node_modules\@wepy\cli\bin\wepy.js

11760 error dest C:\Users\my\AppData\Roaming\npm\wepy

11761 error EEXIST: file already exists, cmd shim 'C:\Users\my\AppData\Roaming\npm\node_modules\@wepy\cli\bin\wepy.js' -> 'C:\Users\my\AppData\Roaming\npm\wepy'

11762 error File exists: C:\Users\my\AppData\Roaming\npm\wepy

11763 error Remove the existing file and try again, or run npm

11764 error with --force to overwrite files recklessly.

根据提示判断我之前安装的wepy1与现在的wepy2安装有冲突,

找到目录C:\Users\my\AppData\Roaming\npm下删除文件wepy.js,

重新运行npm install @wepy/cli -g ,根据提示删除wepy,wepy.cmd

运行npm install @wepy/cli -g 安装成功。