Sami Kahsay
Sami Kahsay

Reputation: 39

installing npm in cpanel

This is the error message:

/home/hulukfyacom/nodevenv/myapp/10/bin/npm: fork: Cannot allocate memory
/home/hulukfyacom/nodevenv/myapp/10/bin/npm: line 13: /home/hulukfyacom/myapp/activate: No such file or directory
/home/hulukfyacom/nodevenv/myapp/10/bin/npm: line 14: /home/hulukfyacom/myapp/set_env_vars.py: No such file or directory
mkdir: cannot create directory '/lib/node_modules': Read-only file system
ln: failed to create symbolic link '/lib/package.json': Read-only file system
/home/hulukfyacom/nodevenv/myapp/10/bin/npm: line 35: /usr/bin/npm: No such file or directory

I am currently hosting my nodejs website and when I try to install npm it showed me this error. How can I solve this error please...any help...

Upvotes: 1

Views: 12116

Answers (1)

mprather
mprather

Reputation: 170

You will need to create a symlink to your node and npm executables:

ln -s /opt/cpanel/ea-nodejs10/bin/npm /usr/local/sbin/npm
ln -s /opt/cpanel/ea-nodejs10/bin/node /usr/local/sbin/node

Not 100% sure if this is accurate since I don't have access to CPanel to test.

Although on further inpsection, it looks like you may be out of memory or even the file permissions are wrong. If the symlink does not work, can you run the following commands?

htop

If your memory is maxed out, this may be the source of your problem.

df -lh

This command will list the free hard disk space. Make sure the disk is not full.

ls -l

This will list the files and permissions, make sure that the file permissions are correct.

^These things are presuming that you have command line access. You should be able to check the resource usage from the CPanel interface if you need.

Upvotes: 2

Related Questions