关于npm install时,报错 Failed at the phantomjs-prebuilt@2.1.14 install script

在执行npm install有时会报错:

1
2
3
4
5
6
7
npm ERR! phantomjs-prebuilt@2.1.14 install: `node install.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the phantomjs-prebuilt@2.1.14 install script 'node install.js

这是由于安装phantomjs-prebuilt执行脚本失败导致的,解决方法就是不执行phantomjs-prebuilt脚本,只安装相关依赖,在npm install时添加后缀--ignore-scripts即可:

1
npm install --ignore-scripts

大功告成!