smilly92
smilly92

Reputation: 2443

Updating NPM on OpenShift

Is it possible to update NPM to the latest version in an OpenShift application? (It comes with version 1.2.17 by default and I'm trying to upgrade to 1.4.x)

Running the usual NPM command npm update npm -g returns a permission error;

Error: EACCES, unlink '/opt/rh/nodejs010/root/usr/lib/node_modules/npm'

And running sudo npm update npm -g gives a permission denied (bash: /usr/bin/sudo: Permission denied)

Upvotes: 0

Views: 1309

Answers (2)

ʀɣαɳĵ
ʀɣαɳĵ

Reputation: 1982

These tips on how to add your own globally installed npm mods to OpenShift might work for this purpose - https://gist.github.com/ryanj/9751652

I haven't tried using this script to update npm itself, but it could be worth a shot.

Let me know if it works!

Upvotes: 1

majidarif
majidarif

Reputation: 20005

You might not have the proper permissions, you might also want to remove nodejs and retry to install but before that try doing:

sudo chmod +x $(which node)

or

sudo chmod 755 $(which node) && sudo npm update npm -g 

Also as for the first error it seems you have a permission error on your home directories NPM folders. Try to check if everything in your home dir is owned by you.

Upvotes: 0

Related Questions