首页 > 技术文章 > npm install @wepy/cli -g 出错

xiaofeilin 2020-07-27 16:25 原文

npm install @wepy/cli -g 出错:npm ERR! Unexpected end of JSON input while parsing near '...1.0.0"}
  1. C:\Users\admin>npm install @wepy/cli -g
  2. npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellane
  3. ous Warning ECONNRESET: request to https://registry.npmjs.org/@wepy%2fcli failed
  4. , reason: read ECONNRESET
  5. npm WARN registry Using stale data from https://registry.npmjs.org/ due to a req
  6. uest error during revalidation.
  7. npm WARN deprecated request@2.88.2: request has been deprecated, see https://git
  8. hub.com/request/request/issues/3142
  9. npm ERR! Unexpected end of JSON input while parsing near '...1.0.0"},"devDepende
  10. nc'
  11.  
  12. npm ERR! A complete log of this run can be found in:
  13. npm ERR!     D:\install\nodejs\node_cache\_logs\2020-02-21T11_35_59_278Z-debug.l
  14. og

解决

  • 更换镜像

  1. npm set registry https://registry.npmjs.org/
  • 清除缓存

  1. npm cache clean --force

 原链接https://faceghost.com/article/469121

推荐阅读