yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Error when trying to install phantomjs-launcher on Windows

Open craigpalermo opened this issue 10 years ago • 15 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? I get the following error when trying to install phantomjs-prebuilt. The same thing happens using the past few versions of this package. Is this something that needs to be fixed by the package author in order to make it compatible with Yarn?

$ yarn add [email protected]
yarn add v0.15.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error C:\Users\cpalermo\node_modules\phantomjs-prebuilt: UNKNOWN: unknown error, open 'C:\Users\cpalermo\AppData\Local\Yarn\npm-phantomjs-prebuilt-2.1.10\lib\phantom\bin\phantomjs.exe'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/add for documentation about this command.

If the current behavior is a bug, please provide the steps to reproduce. Run yarn add phantomjs-prebuilt, with or without --save/--dev/etc.

What is the expected behavior? Install package without error

Please mention your node.js, yarn and operating system version. Node v6.7.0 Yarn v0.15.1 Windows 7

craigpalermo avatar Oct 12 '16 19:10 craigpalermo

I've also noticed similar strange things on Mac when installing the 'phantomjs' package. Typically running the same command again has resolved it for me. Havn't looked any further with this particular issue yet.

arcticShadow avatar Oct 12 '16 20:10 arcticShadow

@arcticShadow I've also tried running the command multiple times, but it seems to just clear Yarn's cached version of the package and start from scratch (probably because the previous installation failed, so the yarn.lock file isn't updated).

craigpalermo avatar Oct 12 '16 20:10 craigpalermo

I'm also noting some strange errors with phantomjs but it seems to work fine with npm install

yarn install
yarn install v0.15.1
info No lockfile found.
warning [email protected]: Dependency "path" listed in "devDependencies" is the name of a built-in module
[1/4] Resolving packages...
warning [email protected]: Please use gulp-clean-css
warning gulp > vinyl-fs > glob-stream > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
warning browser-sync > localtunnel > request > [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
warning gulp-imagemin > imagemin-optipng > exec-buffer > execa > [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
[2/4] Fetching packages...
warning [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning [email protected]: The engine "rhino" appears to be invalid.
warning [email protected]: The engine "rhino" appears to be invalid.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/5] ⠈ gifsicle
[2/5] ⠈ jpegtran-bin
[3/5] ⠈ optipng-bin
[-/5] ⠈ waiting...
error /home/matthew/Projects/site/httpdocs/themes/default/node_modules/phantomjs: Command failed.
Exit code: 1
Command: sh
Arguments: -c node install.js
Directory: /home/matthew/Projects/site/httpdocs/themes/default/node_modules/phantomjs
Output:
Considering PhantomJS found at /usr/bin/phantomjs
Found PhantomJS at /usr/bin/phantomjs ...verifying
PhantomJS detected, but wrong version 2.1.1 @ /usr/bin/phantomjs.
Phantom installation failed TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)
    at findSuitableTempDirectory (/home/matthew/Projects/site/httpdocs/themes/default/node_modules/phantomjs/install.js:127:30)
    at /home/matthew/Projects/site/httpdocs/themes/default/node_modules/phantomjs/install.js:476:19
    at nextTickCallback (/home/matthew/Projects/site/httpdocs/themes/default/node_modules/kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9) TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)
    at findSuitableTempDirectory (/home/matthew/Projects/site/httpdocs/themes/default/node_modules/phantomjs/install.js:127:30)
    at /home/matthew/Projects/site/httpdocs/themes/default/node_modules/phantomjs/install.js:476:19
    at nextTickCallback (/home/matthew/Projects/site/httpdocs/themes/default/node_modules/kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at SpawnError (/opt/nodejs/lib/node_modules/yarn/lib/errors.js:18:1)
    at ChildProcess.proc.on.code (/opt/nodejs/lib/node_modules/yarn/lib/util/child.js:107:15)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.

hailwood avatar Oct 12 '16 21:10 hailwood

I also get the same unknown error as @unscsprt on one environment, but it works fine on another. Both are running on Node 5.3.0 and Yarn 0.15.1.

frenic avatar Oct 13 '16 22:10 frenic

Another interesting detail is wasn't until I updated [email protected] to [email protected] it started working on one of my environments. With [email protected] both failed. When I compare those versions it's basically just a dependency update, es6-promise@~3.2.1 to es6-promise@~4.0.3.

frenic avatar Oct 14 '16 08:10 frenic

Interesting @faddee ... I'm going to try using that version in my project and see what happens

comfroels avatar Oct 14 '16 14:10 comfroels

Yup [email protected] definitely works in my Win 10 environment and my vagrant environment (Ubuntu).

comfroels avatar Oct 14 '16 14:10 comfroels

Same issue here, Windows 7. [email protected] does NOT work for me.

$ yarn
yarn install v0.15.1
info No lockfile found.
error npm-shrinkwrap.json found. This will not be updated or respected. See [TODO] for more information.
[1/4] Resolving packages...
warning tslint > findup-sync > glob > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning [email protected]: The engine "rhino" appears to be invalid.
[3/4] Linking dependencies...
warning Unmet peer dependency "babel-core@^6.0.0".
[4/4] Building fresh packages...
[1/1] ⠠ phantomjs-prebuilt: Cached build artifact lib
[-/1] ⠠ waiting...
[-/1] ⠠ waiting...
[-/1] ⠠ waiting...
error C:\Project\node_modules\phantomjs-prebuilt: UNKNOWN: unknown error, open 'C:\Users\enoshixi\AppData\Local\Yarn\npm-phantomjs-prebuilt-2.1.13\lib\phantom\bin\phantomjs.exe'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.

enoshixi avatar Oct 17 '16 15:10 enoshixi

Version 0.16.0 comes with numerous bug fixes and the command is working on Windows 7 for myself. Can anyone else who experienced an issue previously retry with 0.16.+?

busches avatar Oct 19 '16 15:10 busches

I am still getting the exact same error using yarn 0.16.1.

enoshixi avatar Oct 19 '16 17:10 enoshixi

I ran into a new error with [email protected] so I can't really tell for now.

frenic avatar Oct 19 '16 21:10 frenic

Working now with [email protected]

frenic avatar Oct 21 '16 08:10 frenic

@hailwood's issue looks like #1538.

joshkel avatar Oct 28 '16 16:10 joshkel

@joshkel I'm having this issue again and the TMPDIR workaround didn't help.

frenic avatar Nov 04 '16 12:11 frenic

@faddee I think @hailwood's issue (with the TMPDIR workaround) is different than the problems that others are describing in this issue. I haven't seen the "unknown error" messages myself, so I could be wrong.

joshkel avatar Nov 04 '16 12:11 joshkel