window 10 npm install node-sass报错

最近准备想用vue-cli初始化一个项目,须要sass-loader编译;html

发现window下npm install node-sass和sass-loader一直报错,vue

window 命令行中提示我全局安装 node-gyp ,有些提示好像是本地找不到python,node

因而我按照提示安装node-gyppython

node-gyp是一个用Node.js编写的跨平台命令行工具,用于编译Node.js的本地插件模块。vue-cli

node-gypnpm

node-gyp官方网址https://www.npmjs.com/package/node-gypwindows

命令行代码sass

 

npm install -g node-gyp

 

 

 

安装以后仍是发现出错,最后发现官方文档window环境下要安装window本身的构建工具dom

 

因此还要写入一行命令工具

npm install --global --production windows-build-tools

 

 

 

 

 

须要注意一点,因为权限这个命令必需要在管理员运行的cmd命令窗口内

 

安装成功后就能够安装node-sass了,但愿能帮助到你们

 

转载自 http://www.javashuo.com/article/p-ehngkanu-dh.html

相关文章
相关标签/搜索