1、问题概述?
在mac os系统,执行npm install的时候报错:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tangxiaochun/.npm/_logs/2024-02-29T07_08_23_023Z-debug.log
最重要的意思就是说少了:
Failed at the phantomjs-prebuilt@2.1.16 install script.
2、解决方案
我们额外的手动安装这个组件就可以了。
sudo表示以管理员身份运行
sudo npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
安装后:我们发现sudo npm install执行成功