taro 安装/更新报错记录

最近接了个微信项目,使用taro来开发,经常taro init 项目的时候,发现项目都不完整, 所以想到是不是包错误,卸载重装,发现报如下错误:
记录时间:2020-03-06
执行的命令

npm install -g @tarojs/cli

报的错误:

npm ERR! path D:\Program Files (x86)\node\node_global\node_modules\@tarojs\cli\node_modules\.bin\rimraf.cmdnpm ERR! code EEXIST
npm ERR! Refusing to delete D:\Program Files (x86)\node\node_global\node_modules\@tarojs\cli\node_modules\.bin\rimraf.cmd: is outside D:\Program Files (x86)\node\node_global\node_modules\@tarojs\cli\node_modules\rimraf and not a link
npm ERR! File exists: D:\Program Files (x86)\node\node_global\node_modules\@tarojs\cli\node_modules\.bin\rimraf.cmd
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Program Files (x86)\node\node_cache\_logs\2020-03-06T01_47_59_712Z-debug.log

截图:
在这里插入图片描述
taro 的论坛资料很少,查了很久都没找到解决方案, 关注到一个错误里面的关键语句:

Refusing to delete D:\Program Files (x86)\node\node_global\node_modules\@tarojs\cli\node_modules\.bin\rimraf.cmd: is outside D:\Program Files (x86)\node\node_global\node_modules\@tarojs\cli\node_modules\rimraf and not a link

发现可能是npm 的原因,导航到这个文件地址,删除掉整个tarojs/cli包文件夹
再次执行:

npm install -g @tarojs/cli

安装成功!

npm包安装错误问题参考:http://www.bubuko.com/infodetail-3367068.html

但是当执行时又出现错误,因为我的项目在另一个文件夹,把除了node_modules文件夹的所有文件都copy了过去,正常的 yarn install 、 yarn dev:weapp。
但是却报如下错误:

PS F:\wx-web> yarn run dev:weapp
yarn run v1.19.1
$ npm run build:weapp -- --watch

> we@1.0.0 build:weapp F:\wx-web
> taro build --type weapp "--watch"

文件名、目录名或卷标语法不正确。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! we@1.0.0 build:weapp: `taro build --type weapp "--watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the we@1.0.0 build:weapp script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Program Files (x86)\node\node_cache\_logs\2020-03-06T03_52_17_620Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

截图:
在这里插入图片描述
后使用:

npm run dev:weapp

成功!
但具体为什么这样还不清楚。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

caperxi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值