react-native init 失败,Error: Couldn't find package "babel-generator@^6.26.0" required by "babel-core@^6.24.1" on the "npm" registry.



  • 之前是已经init成功过的,但是现在init一直失败,实在不知道咋整了,已经设置了淘宝镜像
    Trace:
    Error: Couldn't find package "babel-generator@^6.26.0" required by "babel-core@^6.24.1" on the "npm" registry.
    at new MessageError (C:\Users\XXX\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:186:110)
    at PackageRequest.<anonymous> (C:\Users\XXX\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:36274:17)
    at Generator.throw (<anonymous>)
    at step (C:\Users\XXX\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:98:30)
    at C:\Users\XXX\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:111:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)



  • 有人遇到过这个问题嘛?



  • 不知道是不是网络原因,在没有修改的情况下,下午init又成功了。如果又碰到同样情况的盆友,建议换个时间段试试。



  • 首先去确认一下是否真的安装了babel-generator,如果没有安装手动npm install一下,如果确定安装了,建议清理一下npm缓存


Log in to reply