Home > Blockchain >  Finding which node version manager is installed
Finding which node version manager is installed

Time:05-12

I don't know which node version managers there are, but it's not installed with apt, and nvm. I'm using Debian based pop_os. If there's a way to tell where nodejs is installed then that would be super, as I imagine that would indicate node version manager is used.

CodePudding user response:

npm is the package manager for the Node JavaScript platform in Ubuntu-based operating systems. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. It is extremely configurable to support a wide variety of use cases. Most commonly, it is used to publish, discover, install, and develop node programs.

Install also node-opener to have full npm features enabled.

sudo apt update
sudo apt install npm node-opener

To find out where node.js is installed run the following command:

which nodejs && which node

An up-to-date version of npm will installed as part of the node snap. npm should be run outside of the node repl, in your normal shell. After installing the node snap run the following command to enable npm update checking:

sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config

Replace your-username in the above command with your own username.

node snap package users can switch between versions of Node.js at any time without needing to involve additional tools like nvm (Node Version Manager), for example:

sudo snap refresh node --channel=18/stable

snap packages exist within a sandboxed environment. To access the installed node snap, run snap run node. To get the version of the installed node snap run snap run node -v For example if you installed node by running sudo snap install node --classic the results of running snap run node -v would be v16.15.0 which is currently the default stable version.

  • Related