npm install failed
fpolli opened this issue · 2 comments
Hi, I was installing the library into a Docker container and after a bunch of deprecated notices, npm install threw an error. I ran git clone per the readme, cd ContentTools and then npm install:
npm ERR! code 1
npm ERR! path /var/www/html/resources/js/ContentTools/node_modules/phantomjs
npm ERR! command failed
npm ERR! command sh -c /tmp/install65745564693.sh
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:371:5)
npm ERR! at validateString (node:internal/validators:120:11)
npm ERR! at Object.join (node:path:1172:7)
npm ERR! at findSuitableTempDirectory (/var/www/html/resources/js/ContentTools/node_modules/phantomjs/install.js:127:30)
npm ERR! at /var/www/html/resources/js/ContentTools/node_modules/phantomjs/install.js:476:19
npm ERR! at nextTickCallback (/var/www/html/resources/js/ContentTools/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:371:5)
npm ERR! at validateString (node:internal/validators:120:11)
npm ERR! at Object.join (node:path:1172:7)
npm ERR! at findSuitableTempDirectory (/var/www/html/resources/js/ContentTools/node_modules/phantomjs/install.js:127:30)
npm ERR! at /var/www/html/resources/js/ContentTools/node_modules/phantomjs/install.js:476:19
npm ERR! at nextTickCallback (/var/www/html/resources/js/ContentTools/node_modules/kew/kew.js:47:28)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:78:11)
Hi @fpolli,
So I'm not sure this is directly related to ContentTools as this seems to be a failure to install PhantomJS, a quick Google shows a number of results for the phrase "PhantomJS not found on PATH". I don't use docker at all I'm afraid so I can't advise on if this might be something specific to docker.
PhantomJS is used for running tests in ContentTools so if you are just trying to include CT in your project you don't need PhantomJS (I don't believe). You should be able to add "ContentTools": "1.6.11"
to your package.json dependencies and install it with npm install
.
EDIT: 1.6.16 is the latest version sorry.
Thanks! I was hoping so. I am working on it now.