I have installed with nodejs through nvm on Centos 8 with root. Everything works as expected with root.
After useradd appUser
and su appUser
I not able to execute nvm
, node
, npm
.
What needs to be done to give my appUser access to node?
I have installed with nodejs through nvm on Centos 8 with root. Everything works as expected with root.
After useradd appUser
and su appUser
I not able to execute nvm
, node
, npm
.
What needs to be done to give my appUser access to node?
2
Answers
I am going to answer my own question because of my findings.
adduser
andsu
to your appUsercurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
source ~/.bash_profile
to set new PATHcd ~
or you get permission denied in step 6 see herenvm install node
Repeat for all users you want node installed
Have you tried the {node –v} command.
If you have and the result might be one of the two:-
Either you get the version successfully. In this case, you have to run all the commands with sudo or superuser.
Or you get an error saying ‘COMMAND NOT FOUND’. In this case, you have to reinstall node for that specific user.
PS: Try to provide a little more details!