Sudo user not using same node version
run ll /usr/bin/node
if this file exist, simply run rm /usr/local/bin/node
from the regular user
explanation
If you'd run which node
from regular user you will probably see it points to the user local bin directory
which node
/usr/local/bin/node
this means that the regular user installed another node version locally.
to let the same node version apply to all users, this command should show you usr bin (not local).
which node
/usr/bin/node
by deleting the link from /usr/local/bin/node
it will automatically start using /usr/bin/node
How to switch Nodejs Version of root user?
I find out that I can simply add the correct which node
path to $PATH.
$which node
/usr/local/bin/node
$sudo su
$which node
/usr/bin/node
$export PATH=$PATH:/usr/local/bin
$node -v
v7.2.0
How to fix npm throwing error without sudo
This looks like a permissions issue in your home directory. To reclaim ownership of the .npm directory execute:
sudo chown -R $(whoami) ~/.npm
how to set specific version of node as default using n
You still need to activate the installed version, installing doesn't automatically switch to that version. Type n
after doing the install and select the version you want. From that point forward, it will be the node version your system uses. You may need to use sudo n
if you run into permission issues.
sudo: npm: command not found
The npm file should be in /usr/local/bin/npm
. If it's not there, install node.js again with the package on their website. This worked in my case.
nvm use not working - what is setting node version to 10?
Wait a minute when you do
nvm use 15
You do it with a normal user, but when you run the code
sudo node dist/proxy.js
Who executes that is not the same user that ran nvm use 15,
The problem is that root has version 10 and normal user has version 15.
You need to sudo nvm use 15, but it is better if you run yow code without sudo
Related Topics
Git: Can't Push (Strange Config Issue)
Linux: How to Lock The Pages of a Process in Memory
Siege Aborted Due to Excessive Socket Failure
Linux: How to Debug a Sigsegv? How to Trace The Error Source
Ubuntu Based Docker-Machine Image
How to Remount The /Proc Filesystem in a Docker as a R/W System
Hidden File .Env Not Copied Using Docker Copy
Linux Shell Programming String Compare Syntax
Splitting Bulk Text File Every N Line
Shared Volume in Docker Through Vagrant
How to Keep Directory Structure with Aria2
Adjust Audio Volume Level with Cli Omxplayer - Raspberry Pi
How to Programmatically Pick and Choose Which Core of a Multi-Core CPU My Thread Should Run On
In Linux, Physical Memory Pages Belong to The Kernel Data Segment Are Swappable or Not