Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhantomJS not found on PATH - installation via npm install #125

Closed
limh25 opened this issue Aug 30, 2022 · 2 comments
Closed

PhantomJS not found on PATH - installation via npm install #125

limh25 opened this issue Aug 30, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@limh25
Copy link

limh25 commented Aug 30, 2022

Just tried to install the database and got an error at the installation process below:

cd chateau
npm install

The error message:

npm ERR! code 1
npm ERR! path /home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! PhantomJS not found on PATH
npm ERR! Phantom installation failed TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
npm ERR!     at new NodeError (node:internal/errors:372:5)
npm ERR!     at validateString (node:internal/validators:120:11)
npm ERR!     at Object.join (node:path:1172:7)
npm ERR!     at findSuitableTempDirectory (/home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:127:30)
npm ERR!     at /home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:476:19
npm ERR!     at nextTickCallback (/home/limh25/nextstrain/fauna/chateau/node_modules/kew/kew.js:47:28)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:78:11) {
npm ERR!   code: 'ERR_INVALID_ARG_TYPE'
npm ERR! } TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
npm ERR!     at new NodeError (node:internal/errors:372:5)
npm ERR!     at validateString (node:internal/validators:120:11)
npm ERR!     at Object.join (node:path:1172:7)
npm ERR!     at findSuitableTempDirectory (/home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:127:30)
npm ERR!     at /home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:476:19
npm ERR!     at nextTickCallback (/home/limh25/nextstrain/fauna/chateau/node_modules/kew/kew.js:47:28)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:78:11)

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/limh25/.npm/_logs/2022-08-29T20_58_45_014Z-debug-0.log

The error part of the log file:

865 info run [email protected] install node_modules/karma-phantomjs-launcher/node_modules/phantomjs node install.js
1866 info run [email protected] install node_modules/socket.io-client/node_modules/ws (node-gyp rebuild 2> builderror.log) || (exit 0)
1867 info run [email protected] install { code: 1, signal: null }
1868 timing reify:rollback:createSparse Completed in 254ms
1869 timing reify:rollback:retireShallow Completed in 1ms
1870 timing command:install Completed in 5551ms
1871 verbose stack Error: command failed
1871 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
1871 verbose stack     at ChildProcess.emit (node:events:527:28)
1871 verbose stack     at maybeClose (node:internal/child_process:1092:16)
1871 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
1872 verbose pkgid [email protected]
1873 verbose cwd /home/limh25/nextstrain/fauna/chateau
1874 verbose Linux 3.10.0-1160.el7.x86_64
1875 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
1876 verbose node v16.15.0
1877 verbose npm  v8.5.5
1878 error code 1
1879 error path /home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
1880 error command failed
1881 error command sh -c node install.js
1882 error PhantomJS not found on PATH
1883 error Phantom installation failed TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
1883 error     at new NodeError (node:internal/errors:372:5)
1883 error     at validateString (node:internal/validators:120:11)
1883 error     at Object.join (node:path:1172:7)
1883 error     at findSuitableTempDirectory (/home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:127:30)
1883 error     at /home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:476:19
1883 error     at nextTickCallback (/home/limh25/nextstrain/fauna/chateau/node_modules/kew/kew.js:47:28)
1883 error     at processTicksAndRejections (node:internal/process/task_queues:78:11) {
1883 error   code: 'ERR_INVALID_ARG_TYPE'
1883 error } TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
1883 error     at new NodeError (node:internal/errors:372:5)
1883 error     at validateString (node:internal/validators:120:11)
1883 error     at Object.join (node:path:1172:7)
1883 error     at findSuitableTempDirectory (/home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:127:30)
1883 error     at /home/limh25/nextstrain/fauna/chateau/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:476:19
1883 error     at nextTickCallback (/home/limh25/nextstrain/fauna/chateau/node_modules/kew/kew.js:47:28)
1883 error     at processTicksAndRejections (node:internal/process/task_queues:78:11)
1884 verbose exit 1
1885 timing npm Completed in 5735ms
1886 verbose unfinished npm timer reify 1661806725196
1887 verbose unfinished npm timer reify:build 1661806730162
1888 verbose unfinished npm timer build 1661806730163
1889 verbose unfinished npm timer build:deps 1661806730163
1890 verbose unfinished npm timer build:run:install 1661806730176
1891 verbose unfinished npm timer build:run:install:node_modules/phantomjs-prebuilt 1661806730176
1892 verbose unfinished npm timer build:run:install:node_modules/karma-phantomjs-launcher/node_modules/phantomjs 1661806730191
1893 verbose unfinished npm timer build:run:install:node_modules/socket.io-client/node_modules/ws 1661806730203
1894 verbose code 1
1895 error A complete log of this run can be found in:
1895 error     /home/limh25/.npm/_logs/2022-08-29T20_58_45_014Z-debug-0.log

Your environment: if running Nextstrain locally

  • Operating system: Amazon Linux 2
  • Browser: command line
  • Version (e.g. auspice 2.7.0): nextstrain.cli 4.1.1, node v16.15.0, npm 8.5.5; nextstrain.cli updated to 4.2.0 and still getting the same error.

Additional context

I have tried to solve it my own by googling, but no luck so far.
Please help.

@joverlee521
Copy link
Contributor

Hello @limh25,

This step is only required for installing Chateau, which is data explorer for the database. You do not need to install it to create or work with the database.

If you do wish to use Chateau to explore the data, then I believe you can skip the installation of karma since it is a dev dependency only used for testing. You can skip dev dependencies by running

npm install --production

I didn't dig much into the error itself, but there is an open issue in karma-phantomjs-launcher for this error.

Hope that helps!

@limh25
Copy link
Author

limh25 commented Sep 1, 2022

@joverlee521

Thank you for your help. I did not know that chateau is not required to work with the database.
Also, the production installation works.

Thanks again!

@limh25 limh25 closed this as completed Sep 1, 2022
Repository owner moved this from New to Done in Nextstrain planning (archived) Sep 1, 2022
joverlee521 added a commit that referenced this issue Sep 1, 2022
This commit is a response to #125.

- Clarify that Chateau is an optional installation step and only used
for data exploration.
- Update the npm command to use the `--production` flag to avoid
installing dev dependencies for Chateau.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

2 participants