nvm is not compatible with the npm config “prefix” option:

Delete and Reset the prefix $ npm config delete prefix $ npm config set prefix $NVM_DIR/versions/node/v6.11.1 Note: Change the version number with the one indicated in the error message. nvm is not compatible with the npm config “prefix” option: currently set to “/usr/local” Run “npm config delete prefix” or “nvm use –delete-prefix v6.11.1 –silent” to … Read more

How to install nvm in docker?

When you RUN bash… each time that runs in a separate process, anything set in the environment is not maintained. Here’s how I install nvm: # Replace shell with bash so we can source files RUN rm /bin/sh && ln -s /bin/bash /bin/sh # Set debconf to run non-interactively RUN echo ‘debconf debconf/frontend select Noninteractive’ … Read more

Can’t use NVM from root (or sudo)

The below list of commands (source: digitalocean) seems to fix the problem WARNING!!!! In some circumstances, these commands can break your system! Make sure you know what do these command do!!! related n=$(which node); \ n=${n%/bin/node}; \ chmod -R 755 $n/bin/*; \ sudo cp -r $n/{bin,lib,share} /usr/local The above command is a bit complicated, but … Read more

How to properly upgrade node using nvm

This may work: nvm install NEW_VERSION –reinstall-packages-from=OLD_VERSION For example: nvm install 6.7 –reinstall-packages-from=6.4 then, if you want, you can delete your previous version with: nvm uninstall OLD_VERSION Where, in your case, NEW_VERSION = 5.4 OLD_VERSION = 5.0 Alternatively, try: nvm install stable –reinstall-packages-from=current

Visual Studio Code to use node version specified by NVM

In VS Code: go to your launch.json file add the runtimeVersion attribute inside configurations as shown below In this example, we are assuming 4.8.7 is already installed using nvm: { “version”: “<some-version>”, “configurations”: [ { “type”: “node”, “runtimeVersion”: “4.8.7”, // If i need to run node 4.8.7 “request”: “launch”, “name”: “Launch”, “program”: “${workspaceFolder}/sample.js” } ]}