nodejs npm包安装

设置下载镜像地址

1
2
3
4
5
6
7
# 国内地址
npm config set registry https://registry.cnpmjs.org
# 淘宝npm代理
npm config set registry https://registry.npm.taobao.org
# 安装包错误 npm ERR! Unexpected end of JSON input while parsing near...
# 则切换回国内代理或者清除缓存
npm cache clean --force

代理

1
2
npm config set proxy http://127.0.0.1:1080
npm config delete proxy

windows

1
2
3
4
# 安装包时提示 MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”
# 则需要以管理员权限运行
npm install --global windows-build-tools
npm install -g node-gyp

安装sass

binding.node 下载地址:https://github.com/sass/node-sass/releases/
安装方法:

文章目录
  1. 1. 设置下载镜像地址
  2. 2. 代理
  3. 3. windows
  4. 4. 安装sass