webstorm使用npm 指令报错解决方案
1.操作环境win10webstorm2020.1引入vue前端项目2.安装node.jspython-2.7安装下载注:node.js需要先安装Python,必须是python-2.7,python3不行node-v8.17.0安装下载注:我开始安装最新版的,遇到各种不兼容问题,后来重新选择node-v8.17.0终于搭建好了,其它版本也可以试试.以管理员的方式进入cmd查看...
·
1.操作环境
win10
webstorm2020.1
引入vue前端项目
2.安装node.js
python-2.7安装下载
注:node.js需要先安装Python,必须是python-2.7,python3不行
node-v8.17.0安装下载
注:我开始安装最新版的,遇到各种不兼容问题,后来重新选择
node-v8.17.0终于搭建好了,其它版本也可以试试.
以管理员的方式进入cmd查看配置node.js:
1.查看版本
node -v
2.设置淘宝镜像库
1、
npm config set registry https://registry.npm.taobao.org
npm config get registry
2、npm install -g node-gyp
3、npm install –global –production windows-build-tools
4、npm rebuild node-sass
3.webstorm 配置
开始下载依赖
npm cache clean --force
npm install
依赖下载完成,启动项目
npm run serve
访问项目
http://localhost:8080/
4.以上方案就是解决安装过程中踩的坑,仅供参考
Failed to compile.
./src/views/chat/FriendChat.vue?vue&type=style&index=0&id=2f3948a3&lang=scss&scoped=true& (./node_modules/css-loader??ref--8-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/chat/FriendChat.vue?vue&type=style&index=0&id=2f3948a3&lang=scss&scoped=true&)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Missing binding D:vueproject\node_modules\node-sass\vendor\win32-x64-57\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 8.x
Found bindings for the following environments:
- Windows 64-bit with Node.js 8.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
at module.exports (D:vueproject\node_modules\node-sass\lib\binding.js:15:13)
at Object.<anonymous> (D:vueproject\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at getDefaultSassImplementation (D:vueproject\node_modules\sass-loader\dist\getDefaultSassImplementation.js:24:10)
at getSassImplementation (D:vueproject\node_modules\sass-loader\dist\getSassImplementation.js:19:72)
at Object.loader (D:vueproject\node_modules\sass-loader\dist\index.js:40:61)
更多推荐
已为社区贡献1条内容
所有评论(0)