镜像
NPM MIRROR
npm镜像
bash
# 原始镜像
https://registry.npmjs.org/
# 淘宝
https://npm.taobao.org => https://npmmirror.com
https://registry.npm.taobao.org => https://registry.npmmirror.comcnpm使用
bash
npm install -g cnpm --registry=https://registry.npmmirror.com镜像安装
bash
yarn install --registry=https://registry.npmmirror.com
npm install --registry=https://registry.npmmirror.comnpm包下载
一般在nvm下载失败时手动下载替换
bash
https://registry.npmmirror.com/binary.html?path=npm/
https://github.com/npm/cli/releases下载解压并重命名为npm,放置到 path/nvm/${version}/node_modules,并把npm/bin下的npm、npm.cmd、npx、npx.cmd复制放到path/nvm/${version}下
phantomjs下载失败
1. 手动下载二进制文件
- 下载地址:访问PhantomJS 官方下载页获取
phantomjs-2.1.1-windows.zip文件 - 存放路径:将文件保存到日志指定的临时目录:
C:\Users\xxx\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip- 重新安装:
bash
npm install phantomjs-prebuilt@2.1.162. 忽略安装脚本(快速修复)
bash
npm install phantomjs-prebuilt@2.1.16 --ignore-scripts此命令跳过
install.js脚本的执行,避免触发证书验证适用场景:网络不稳定或镜像源证书异常时。
3. 重新安装
npm install