**npm ERR! code 1
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! no**
像这种安装各种包比如 npm install node-sass 还有 npm install 等 gyp报错的 直接切换淘宝镜像安装,大部分直接解决,屡试不爽~~~
解决方案:
1.配置淘宝镜像:
npm config set registry https://registry.npm.taobao.org
2.切换成cnpm安装:
npm install -g cnpm --registry=https://registry.npm.taobao.org
3.安装你需要的包。比如node-sass
cnpm i sass-loader node-sass -D