前端遇到的一些坑

@bingoogolapple 2017-08-16 03:23:01发表于 bingoogolapple/bingoogolapple.github.io FE

npm install 时总是报 phantomjs-prebuilt@2.1.14 安装失败

npm install --ignore-scripts
> phantomjs-prebuilt@2.1.14 install /opt/jenkins/workspace/后台管理系统/frontend/node_modules/phantomjs-prebuilt
> node install.js

module.js:471
    throw err;
    ^

Error: Cannot find module '/opt/jenkins/workspace/后台管理系统/frontend/node_modules/phantomjs-prebuilt/install.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 3.10.0-514.26.2.el7.x86_64
npm ERR! argv "/opt/node-v6.9.2-linux-x64/bin/node" "/opt/node/bin/npm" "install"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE

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'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs phantomjs-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.