Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Phantom installation failed TypeError: Path must be a string. Received undefined #200

Open
Lekensteyn opened this issue May 27, 2017 · 4 comments

Comments

@Lekensteyn
Copy link

Lekensteyn commented May 27, 2017

Please bump the phantomjs-prebuilt dependency to at least 2.1.8 to fix a crash when the TMPDIR environment variable is not set. Upstream fix: Medium/phantomjs@5e6598f

Workaround: set TMPDIR=/tmp on Linux to avoid this report:

    PhantomJS not found on PATH
    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 (/shared/www/console_view/node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt/install.js:127:30)
        at /shared/www/console_view/node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt/install.js:476:19
        at nextTickCallback (/shared/www/console_view/node_modules/kew/kew.js:47:28)
        at _combinedTickCallback (internal/process/next_tick.js:73:7)
        at process._tickCallback (internal/process/next_tick.js:104:9) TypeError: Path must be a string. Received undefined
        at assertPath (path.js:7:11)
        at Object.join (path.js:1211:7)
        at findSuitableTempDirectory (/shared/www/console_view/node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt/install.js:127:30)
        at /shared/www/console_view/node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt/install.js:476:19
        at nextTickCallback (/shared/www/console_view/node_modules/kew/kew.js:47:28)
        at _combinedTickCallback (internal/process/next_tick.js:73:7)
        at process._tickCallback (internal/process/next_tick.js:104:9)

node v7.10.0, npm 4.6.1, yarn 0.24.6, karma-phantomjs-launcher 1.0.4

Lekensteyn added a commit to Lekensteyn/guanlecoja that referenced this issue May 27, 2017
gulp-sass is bumped for node v7.10.0 support.
phantomjs-prebuilt is bumped past 2.1.8 to solve installation failure
when TMPDIR is not set.

Note that one dependency is still unfixed and thus needs a workaround:
karma-runner/karma-phantomjs-launcher#200
Lekensteyn added a commit to Lekensteyn/guanlecoja that referenced this issue May 27, 2017
gulp-sass is bumped for node v7.10.0 support.
phantomjs-prebuilt is bumped past 2.1.8 to solve installation failure
when TMPDIR is not set.

Note that one dependency is still unfixed and thus needs a workaround:
karma-runner/karma-phantomjs-launcher#200
@mikkelwf
Copy link

mikkelwf commented Aug 5, 2017

Is this issue solved or what..?

I get a similar error when trying to run with the launcher @1.0.4 on gitlab:

Error running command: Path must be a string. Received null
TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1431:5)
    at phantomJSExePath (/builds/whnue/whnue-client/node_modules/karma-phantomjs-launcher/index.js:18:12)
    at Object.<anonymous> (/builds/whnue/whnue-client/node_modules/karma-phantomjs-launcher/index.js:107:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at getKarmaPluginConfig (/builds/whnue/whnue-client/node_modules/nwb/lib/createKarmaConfig.js:140:18)
    at createKarmaConfig (/builds/whnue/whnue-client/node_modules/nwb/lib/createKarmaConfig.js:163:31)
    at karmaServer (/builds/whnue/whnue-client/node_modules/nwb/lib/karmaServer.js:30:53)
    at testReact (/builds/whnue/whnue-client/node_modules/nwb/lib/commands/test-react.js:17:29)
    at cli (/builds/whnue/whnue-client/node_modules/nwb/lib/cli.js:263:5)
    at Object.<anonymous> (/builds/whnue/whnue-client/node_modules/nwb/lib/bin/nwb.js:31:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

@adreyfus
Copy link

I had this error in an other project, and adding phantomjs-prebuilt ^2.1.8 to the dependencies resolved the problem.
Then, thanks !

p12tic pushed a commit to p12tic/buildbot that referenced this issue Apr 23, 2019
gulp-sass is bumped for node v7.10.0 support.
phantomjs-prebuilt is bumped past 2.1.8 to solve installation failure
when TMPDIR is not set.

Note that one dependency is still unfixed and thus needs a workaround:
karma-runner/karma-phantomjs-launcher#200
p12tic pushed a commit to p12tic/buildbot that referenced this issue Apr 23, 2019
gulp-sass is bumped for node v7.10.0 support.
phantomjs-prebuilt is bumped past 2.1.8 to solve installation failure
when TMPDIR is not set.

Note that one dependency is still unfixed and thus needs a workaround:
karma-runner/karma-phantomjs-launcher#200
@SDAdham
Copy link

SDAdham commented Dec 26, 2021

I am receiving this error in gitlab pipeline only not my local environment, adding phantomjs-prebuilt does not fix the issue. this happens in image: cypress/browsers:node16.5.0-chrome94-ff93 when i run yarn install here is full error details:

➤ YN0000: │ @fortawesome/fontawesome-common-types@npm:0.2.36 STDOUT 
➤ YN0000: │ serial-number@npm:1.3.0 STDERR Could not read serial number: Error: Command failed: dmidecode -t system | grep Serial
➤ YN0000: │ serial-number@npm:1.3.0 STDERR /bin/sh: 1: dmidecode: not found
➤ YN0000: │ serial-number@npm:1.3.0 STDERR 
➤ YN0000: │ serial-number@npm:1.3.0 STDERR     at ChildProcess.exithandler (node:child_process:397:12)
➤ YN0000: │ serial-number@npm:1.3.0 STDERR     at ChildProcess.emit (node:events:394:28)
➤ YN0000: │ serial-number@npm:1.3.0 STDERR     at maybeClose (node:internal/child_process:1067:16)
➤ YN0000: │ serial-number@npm:1.3.0 STDERR     at Socket.<anonymous> (node:internal/child_process:453:11)
➤ YN0000: │ serial-number@npm:1.3.0 STDERR     at Socket.emit (node:events:394:28)
➤ YN0000: │ serial-number@npm:1.3.0 STDERR     at Pipe.<anonymous> (node:net:672:12) {
➤ YN0000: │ serial-number@npm:1.3.0 STDERR   killed: false,
➤ YN0000: │ serial-number@npm:1.3.0 STDERR   code: 1,
➤ YN0000: │ serial-number@npm:1.3.0 STDERR   signal: null,
➤ YN0000: │ serial-number@npm:1.3.0 STDERR   cmd: 'dmidecode -t system | grep Serial'
➤ YN0000: │ serial-number@npm:1.3.0 STDERR }
➤ YN0000: │ phantomjs@npm:1.9.20 STDOUT Considering PhantomJS found at /tmp/xfs-c512e0ec/phantomjs
➤ YN0000: │ phantomjs@npm:1.9.20 STDOUT Found PhantomJS at /tmp/xfs-c512e0ec/phantomjs ...verifying
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR Error verifying phantomjs, continuing Error: Command failed: /tmp/xfs-c512e0ec/phantomjs --version
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR node:internal/validators:119
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     ^
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR 
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at new NodeError (node:internal/errors:370:5)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at validateString (node:internal/validators:119:11)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at normalizeSpawnArguments (node:child_process:503:3)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at spawn (node:child_process:691:13)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Object.<anonymous> (/builds/WxdB1zk9/0/<proj>/node_modules/phantomjs/bin/phantomjs:22:10)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Module._compile (node:internal/modules/cjs/loader:1095:14)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Module.load (node:internal/modules/cjs/loader:975:32)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Function.Module._load (node:internal/modules/cjs/loader:816:12)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR   code: 'ERR_INVALID_ARG_TYPE'
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR }
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR 
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at ChildProcess.exithandler (node:child_process:397:12)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at ChildProcess.emit (node:events:394:28)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at maybeClose (node:internal/child_process:1067:16)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR   killed: false,
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR   code: 1,
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR   signal: null,
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR   cmd: '/tmp/xfs-c512e0ec/phantomjs --version'
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR }
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR Phantom installation failed TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at new NodeError (node:internal/errors:370:5)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at validateString (node:internal/validators:119:11)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Object.join (node:path:1172:7)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at findSuitableTempDirectory (/builds/WxdB1zk9/0/<proj>/node_modules/phantomjs/install.js:127:30)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at /builds/WxdB1zk9/0/<proj>/node_modules/phantomjs/install.js:476:19
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at nextTickCallback (/builds/WxdB1zk9/0/<proj>/node_modules/kew/kew.js:47:28)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at processTicksAndRejections (node:internal/process/task_queues:78:11) {
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR   code: 'ERR_INVALID_ARG_TYPE'
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR } TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at new NodeError (node:internal/errors:370:5)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at validateString (node:internal/validators:119:11)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at Object.join (node:path:1172:7)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at findSuitableTempDirectory (/builds/WxdB1zk9/0/<proj>/node_modules/phantomjs/install.js:127:30)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at /builds/WxdB1zk9/0/<proj>/node_modules/phantomjs/install.js:476:19
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at nextTickCallback (/builds/WxdB1zk9/0/<proj>/node_modules/kew/kew.js:47:28)
➤ YN0000: │ phantomjs@npm:1.9.20 STDERR     at processTicksAndRejections (node:internal/process/task_queues:78:11)
➤ YN0009: │ phantomjs@npm:1.9.20 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-161dc214/build.log)
➤ YN0000: │ cypress@npm:8.5.0 STDOUT [STARTED] Task without title.

@frntn
Copy link

frntn commented Jan 18, 2022

Same error as @SDAdham here 😒

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants