1、解决node-pre-gyp install --fallback-to-build 卡住不动
一般是因为需要下载国外的包,要么连VPN,要么使用淘宝的镜像:
使用cnpm:
npm install -g cnpm --registry=https://registry.npm.taobao.org
然后用下面命令安装package.json:
cnpm install
2、Error: spawn xxxx ENOENT原因与解决
原因一般是 :path环境变量配置不当,导致无法找到指定的程序
npm install pm2 -g
3、node安装node-pre-gyp报错的解决方案
npm install node-gyp -g
4、
安装 node npm 并更新到最新版本
yum install epel-release -y
yum install nodejs -y
npm config set registry https://registry.npm.taobao.org
npm config set metrics-registry https://registry.npm.taobao.org
npm config set electron_mirror https://registry.npm.taobao.org
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install -g n
n stable
npm install -g npm
node -v
npm -v