在使用Vue cli@3 搭建工程手脚架的过程中。当我们选择了采用 sass 处理 css 编译。在使用vue create test 命令行执行到最后。会到以下这步:然后开始报错:
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-64_binding.node
由于“你懂得”的原因,到最后下载不下来。
或者下载下来之后npm run serve 还是会报错,呵呵。
给出亲测有效的方法:(敲黑板!)
1. 看到Downloading … .node 那行命令的时候果断Ctrl+C 中断执行。
2. 进入创建好的test目录中执行 cnpm install node-sass
3. 然后执行 cnpm rebuild