I am trying to install NPM for a Node.js application. I have already registered the app using Application Manager and uploaded my package.json file to the application directory. I tried running Ensure Dependencies but got an error saying to run the following command:
cd /home/username/public_html/example.com/app && /opt/cpanel/ea-nodejs10/bin/npm install
I logged into SSH and pasted that command, but instead of installing the node modules specified in package.json I got the following:
npm WARN lifecycle npm is using /opt/cpanel/ea-nodejs10/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> [email protected] install /home/username/public_html/example.com/app/node_modules/puppeteer
> node install.js
sh: node: command not found
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] 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! /root/.npm/_logs/2021-03-27T06_21_36_620Z-debug.log
I am not sure how to access the above log file because WHM does not have a file manager like cpanel does so I can't simply click on a folder and navigate to it.
UPDATE: This problem seems isolated to Puppetter. When I try to run npm i puppeteer after installing all other modules I get the error.
cd /home/username/public_html/example.com/app && /opt/cpanel/ea-nodejs10/bin/npm install
I logged into SSH and pasted that command, but instead of installing the node modules specified in package.json I got the following:
npm WARN lifecycle npm is using /opt/cpanel/ea-nodejs10/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> [email protected] install /home/username/public_html/example.com/app/node_modules/puppeteer
> node install.js
sh: node: command not found
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] 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! /root/.npm/_logs/2021-03-27T06_21_36_620Z-debug.log
I am not sure how to access the above log file because WHM does not have a file manager like cpanel does so I can't simply click on a folder and navigate to it.
UPDATE: This problem seems isolated to Puppetter. When I try to run npm i puppeteer after installing all other modules I get the error.
Last edited: