【记录】mac上vue.js开发环境搭建

环境

操作系统:macOS Mojave Version 10.14.2

步骤

参考之前在windows上搭写的一篇记录

按照流程走到第六步,执行npm install会报错

$  npm install
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm ERR! Unexpected end of JSON input while parsing near '...owserslist":"^4.4.1",'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nicole/.npm/_logs/2019-02-06T12_22_10_870Z-debug.log

stackoverflow的回答是这样的

It is possible your npm cache has a corrupted file, perhaps it partially downloaded something and then got an error. Try npm cache clean --force and see if that helps.
If that doesn’t help look in the log file given in the error message. Find the unexpected end of JSON input message in the log file and look before it to see if there are any other hints to the problem.
You updated your question with a new error message. That one is more specific about the corrupted file. Try removing the cli-1.5.5.tgz file from the path specified and try again. If you are using a web proxy on your network then it is also possible that your proxy has stored a corrupted cache: if you are able then turn off any proxies configured for your system and try a direct download.

这里npm cache 的细节

于是执行了该命令就没问题啦~

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值