最近安装了两次不同版本nodejs后,运行vue会报错,一大堆的错误,忘记截图了。大概是这样的:
Node Sass could not find a binding for your current environment: OS X 64-bit with Node 0.10.x

Found bindings for the following environments:

OS X 64-bit with Node.js 6.x
This usually happens because your environment has changed since running npm install.
Run npm rebuild node-sass to build the binding for your current environment.

网上找了很多方法都不行,rebuild也不行,node-sass也无法安装。
然后用了最笨的方法,删除了node_modules文件夹,然后:

1.重新安装vue-cli npm i -g vue-cli
2.重新安装node_modules npm i

可以使用淘宝镜像cnpm安装速度非常,至于怎样使用淘宝镜像可以百度一下,很简单的
于是问题就这样解决了。。。


woxindead
135 声望1 粉丝