npm install phantomjs-prebuilt@2.1.14 安装报错 最后通过以下命令安装成功:
npm install phantomjs-prebuilt@2.1.14 --ignore-scripts
1、关闭npm的https
npm config set strict-ssl false
2、设置npm的获取地址
npm config set registry "http://registry.npmjs.org/"
npm config set registry http://registry.npm.taobao.org
3、查看当前的npm获取地址
npm config get registry
4、查看系统中的全局路径
npm root -g
或
npm config get prefix
5、解决npm ERR!Windows_NT 6.1.7601 获取代理
npm config get proxy
设置代理为空
npm config set proxy null
然后设置
npm install cnpm -g --registry=https://registry.npm.taobao.org
6、更新npm版本
npm install npm -g
或者
npm install npm -g --ca=null
8、错误代码
C:\Users\Administrator>npm install n -g
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@2.1.8: wanted {"os":"!win32","arch":"
any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! D:\anzhuangweizhi\Node.js\node_cache\_logs\2017-07-12T05_54_29_264Z
-debug.log
解决方法 在后面加上 --force
C:\Users\Administrator>npm install -g n --force
9、错误代码
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
解决方法:关闭npm的https
npm config set strict-ssl false
10、如果安装vue-cli > vue init webpack demo 的时候一直报错
unable to verify the first certificate
,且转换镜像无效, 则:
开始 -》搜索-》regedit-》然后找到了注册表 按照下面的路径找到pro带头的文件删除 或者重命名 然后注销 (再次强调不要重启 不然没用)
进入注册表 之后 接着往下找
这个路径往下找HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings