Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.42k stars 436 forks source link

Failed at the phantomjs-prebuilt@2.1.16 install script. #765

Open dimonge opened 6 years ago

dimonge commented 6 years ago

Can someone help pls. Am getting this error message when build my application using "npm install".

OS: Window 10 npm -v 5.5.1 node -v 8.9.3

467 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): 1468 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"}) 1469 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin 1469 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any 1469 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32 1469 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: ia32 1470 verbose stack Error: phantomjs-prebuilt@2.1.16 install: node install.js 1470 verbose stack spawn bash ENOENT 1470 verbose stack at _errnoException (util.js:1024:11) 1470 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) 1470 verbose stack at onErrorNT (internal/child_process.js:372:16) 1470 verbose stack at _combinedTickCallback (internal/process/next_tick.js:138:11) 1470 verbose stack at process._tickCallback (internal/process/next_tick.js:180:9) 1470 verbose stack From previous event: 1470 verbose stack at runAction (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:74:13) 1470 verbose stack at actions.(anonymous function) (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:50:17) 1470 verbose stack at execAction (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:198:18) 1470 verbose stack at 1470 verbose stack From previous event: 1470 verbose stack at withInit (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:166:15) 1470 verbose stack From previous event: 1470 verbose stack at withInit (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:182:13) 1470 verbose stack at runSerial (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:165:10) 1470 verbose stack at doSerial (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:146:3) 1470 verbose stack at Array. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\bind-actor.js:15:8) 1470 verbose stack at LOOP (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:15:14) 1470 verbose stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:18:7 1470 verbose stack at doParallel (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:130:30) 1470 verbose stack at Array. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\bind-actor.js:15:8) 1470 verbose stack at LOOP (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:15:14) 1470 verbose stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:18:7 1470 verbose stack at runSerial (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:164:30) 1470 verbose stack at doSerial (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:146:3) 1470 verbose stack at Array. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\bind-actor.js:15:8) 1470 verbose stack at LOOP (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:15:14) 1470 verbose stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:18:7 1470 verbose stack at withInit.nodeify (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\actions.js:170:5) 1471 verbose pkgid phantomjs-prebuilt@2.1.16 1472 verbose cwd C:\development_bak\projects\Planmill SPA lib\spa-board 1473 verbose Windows_NT 10.0.16299 1474 verbose argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "phantomjs-prebuilt" 1475 verbose node v8.9.3 1476 verbose npm v5.5.1 1477 error file bash 1478 error path bash 1479 error code ELIFECYCLE 1480 error errno ENOENT 1481 error syscall spawn bash 1482 error phantomjs-prebuilt@2.1.16 install: node install.js 1482 error spawn bash ENOENT 1483 error Failed at the phantomjs-prebuilt@2.1.16 install script. 1483 error This is probably not a problem with npm. There is likely additional logging output above. 1484 verbose exit [ 1, true ]

erdemapaydin commented 6 years ago

exact same error is happening to me.

OS: debian jessie NPM: 5.6.0 node: 9.2.1

also tried different node and npm versions all result in the same error documented in the first post. stangely i did not change any package versions or my node/npm versions but this error showed up anyway and is breaking all my builds.

AythaE commented 6 years ago

Same error here for: OS: Ubuntu 16.04.3 LTS node: 4.2.6 npm: 3.5.2

Creating a symbolic link from nodejs to node fix it on my system:

sudo ln -s /usr/bin/nodejs /usr/bin/node 

It looks like phanton is calling node install.js while the node executable is nodejs causing this error.

dimonge commented 6 years ago

Quick work around in Windows 10

I was able to rebuild my app's packages using the new Linux Bash shell in windows 10 to get around this issue.
I used this article https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/ to activate the shell.

nikhil1226 commented 6 years ago

i am also getting the same error when i run "npm install".

OS: Windows 7(32-bit) node v8.9.1 npm v5.5.1

Error: 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.

mandaputtra commented 6 years ago

still having this error when use, npm install at vue-cli app.


   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:```
mandaputtra commented 6 years ago

I fixed this by download phantomjs manually from its website and place it on the PATH. for me I'm running gnu/Linux is in tmp/phantomjs/ just download the tar.gz file and place it without extracting it

Abadii commented 6 years ago

I had to run the script with sudo npm install get it work. Looks like it's a permission issue

ianleeder commented 5 years ago

Same failure on macOS when running sudo npm install --global phantomjs-prebuilt (local install worked). It's installed in a global context for pageres-cli.

This looks suspect:

Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1535580170447/phantomjs-2.1.1-macosx -> /usr/local/lib/node_modules/phantomjs-prebuilt/lib/phantom
chmod failed: phantomjs was not successfully copied to /usr/local/lib/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs

Pre-creating /usr/local/lib/node_modules/phantomjs-prebuilt/lib/phantom doesn't help, the installer removes it then still fails when it's not found.

Got it to work by adding --unsafe-perm according to this answer. Doesn't sound like a good solution though.

philipjhj commented 5 years ago

Same failure on macOS when running sudo npm install --global phantomjs-prebuilt (local install worked). It's installed in a global context for pageres-cli.

This looks suspect:

Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1535580170447/phantomjs-2.1.1-macosx -> /usr/local/lib/node_modules/phantomjs-prebuilt/lib/phantom
chmod failed: phantomjs was not successfully copied to /usr/local/lib/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs

Pre-creating /usr/local/lib/node_modules/phantomjs-prebuilt/lib/phantom doesn't help, the installer removes it then still fails when it's not found.

Got it to work by adding --unsafe-perm according to this answer. Doesn't sound like a good solution though.

Adding the --unsafe-perm flag solved it for me too.

Before doing so I didn't get the chmod failed warning in my log however, since I used sudo npm install I guess.

My log errors before adding the flag:

2153 info lifecycle phantomjs-prebuilt@2.1.16~install: phantomjs-prebuilt@2.1.16
2154 verbose lifecycle phantomjs-prebuilt@2.1.16~install: unsafe-perm in lifecycle false
2155 verbose lifecycle phantomjs-prebuilt@2.1.16~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/phantomjs-prebuilt/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
2156 verbose lifecycle phantomjs-prebuilt@2.1.16~install: CWD: /usr/lib/node_modules/phantomjs-prebuilt
2157 silly lifecycle phantomjs-prebuilt@2.1.16~install: Args: [ '-c', 'node install.js' ]
2158 silly lifecycle phantomjs-prebuilt@2.1.16~install: Returned: code: 1  signal: null
2159 info lifecycle phantomjs-prebuilt@2.1.16~install: Failed to exec install script
2160 timing action:install Completed in 278469ms
2161 verbose unlock done using ~/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
2162 timing stage:rollbackFailedOptional Completed in 188ms
2163 timing stage:runTopLevelLifecycles Completed in 283243ms
2164 verbose stack Error: phantomjs-prebuilt@2.1.16 install: `node install.js`
2164 verbose stack Exit status 1
cyeluri commented 5 years ago

Hi, Is there a solution for this issue on Windows 10?

Node Version : 8.15.1

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! C:\Users\CYeluri\AppData\Roaming\npm-cache_logs\2019-04-12T19_19_00_170Z-debug.log

C:\Users\CYeluri\WebstormProjects\ui-console-dev-5.1-TEMP>npm install

phantomjs-prebuilt@2.1.16 install C:\Users\CYeluri\WebstormProjects\ui-console-dev-5.1-TEMP\node_modules\phantomjs-prebuilt node install.js

PhantomJS not found on PATH Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-windows.zip Saving to C:\Users\CYeluri\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip Receiving...

Error making request. Error: self signed certificate in certificate chain at TLSSocket.onConnectSecure (_tls_wrap.js:1051:34) at TLSSocket.emit (events.js:189:13) at TLSSocket._finishInit (_tls_wrap.js:633:8)

Please report this full log at https://github.com/Medium/phantomjs npm WARN angular-formly-templates-bootstrap@6.5.1 requires a peer of bootstrap@^3.2.0 but none is installed. You must install peer dependencies yourself. npm WARN babel-loader@6.4.1 requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none is installed. You must install peer dependencies yourself. npm WARN trellis-ui-console@5.0.4-50-trellis-1 No license field. npm WARN The package bootstrap is included as both a dev and production dependency. npm WARN The package moment is included as both a dev and production dependency. npm WARN The package requirejs is included as both a dev and production dependency. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

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! C:\Users\CYeluri\AppData\Roaming\npm-cache_logs\2019-04-12T19_26_09_949Z-debug.log