Questions tagged [nvm]

Node Version Manager - Simple bash script to manage multiple active node.js versions

nvm is a version manager for Node.js. It is designed to be installed per-user and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash). It works on Unix-like operating systems, including Linux, macOS, and Windows WSL.

References

1092 questions
34
votes
7 answers

"nvm use 16.13.0" will return this error "exit status 145: The directory is not empty."

I have 2 versions of node.js , as follow:- Your environment has been set up for using Node.js 17.1.0 (x64) and npm. C:\Windows\System32>nvm list 16.13.0 8.16.2 but when i try to use the first version i got this…
John John
  • 1
  • 72
  • 238
  • 501
33
votes
4 answers

npm link with webpack - cannot find module

I'm trying to npm link a module to a project using webpack as its bundler. Of course, after trying many things, I keep getting this error: ERROR in ./src/components/store/TableView.jsx Module not found: Error: Cannot resolve module…
bmills
  • 537
  • 1
  • 6
  • 12
32
votes
8 answers

How to find what node version a project supports

Is there a way besides trial and error to detect what node version I should use on a repository ? With the fast rise of web frameworks it's becoming a common need to go back to projects from 6, 12 or 24+ months ago. I've been doing this a lot in…
coiso
  • 7,151
  • 12
  • 44
  • 63
32
votes
15 answers

npm is installed using nvm but IntelliJ does not know about it

I installed NPM using NVM. When I use npm in Intellij terminal, it says I don't have NPM installed. But if I use Ubuntu terminal, it is working. Here are what I tried: I have already tried to set my node interpreter (in "Language and Framework" >…
Raymond Pang
  • 667
  • 1
  • 7
  • 17
29
votes
5 answers

Where is node while using nvm?

I am on a MacOS, and I switched from Homebrew Node to NVM, and removed Node from Homebrew but then a lot of my previous packages cannot find Node anymore (Sublime, Heroku etc)...so I have to manually update the location of Node to these…
Aero Wang
  • 8,382
  • 14
  • 63
  • 99
29
votes
3 answers

Update node.js version inside Cloud 9 IDE

My Cloud 9 workspace is running with Node.Js 0.10. How can I update it to the latest version of Node.Js (today is 0.12.4)? I'm trying to install Node.Js using apt-get but I will always get 0.10 version. UPDATE: Latest version of Cloud 9 workspaces…
Davide Icardi
  • 11,919
  • 8
  • 56
  • 77
29
votes
8 answers

Setting up paths in Sublime with NVM

I am using NVM as my node version manager on OSX, which is great except that it creates multiple problems with my IDE. I am using Sublime Text and most of the plugins that I have ever used look for nodejs at /usr/local/bin and since I am using NVM…
tusharmath
  • 10,622
  • 12
  • 56
  • 83
28
votes
6 answers

xcode using wrong node.js version

I am new to React Native. I used react-native init XXX to create a new project. When launch the xcodeproj, I got an error saying: const setupEnvScript = /^win/.test(process.platform) ^^^^^ SyntaxError: Use of const in strict mode. at…
Allan Jiang
  • 11,063
  • 27
  • 104
  • 165
26
votes
10 answers

unknown error on npm install "npm ERR! Unexpected token '.'" on using NVM-Windows, Node v17, NPM v8

This seems to be a semi-common error, but it's unclear to me what is causing it. I want to know what is causing this error and how can I resolve it. Using NVM I have installed Node @latest (Version 17.4.0), which has installed npm's matching latest…
yodama
  • 659
  • 1
  • 9
  • 21
26
votes
3 answers

Is there a way to run "nvm use" automatically in a prestart npm script?

I would like to have automatically invoked "nvm use" when I run "npm start". So I come up with this solution: package.json file "scripts": { "prestart": "sh test.sh", "start": "nodemon index.js" } .nvmrc file 4 test.sh file #!/bin/bash if […
Carl Moravec
  • 261
  • 1
  • 3
  • 4
25
votes
5 answers

Node version not updating after "nvm use" on mac

I am trying to update my local node version from 8.9.0 to 8.10.0 using nvm. But it's not getting reflected. Here's what I tried: node -v -> v8.9.0 nvm use 8.10.0 -> Now using node v8.10.0 (npm v5.5.1) node -v -> v8.9.0 I am unable to get why it…
psr
  • 2,619
  • 4
  • 32
  • 57
24
votes
3 answers

missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Failed to clone nvm repo

** curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash ** When I run this code on my Mac I got an error crun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: …
arpan45
  • 301
  • 1
  • 2
  • 10
24
votes
8 answers

NVM doesn't stick to alias default with ZSH (oh-my-zsh)

I had NVM installed already, then I discovered oh-my-zsh and installed that. It seems to have an nvm plugin, which I enabled in .zshrc. Also I put this in my .zprofile export NVM_DIR="/Users/me/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" …
Thijs Koerselman
  • 21,680
  • 22
  • 74
  • 108
23
votes
1 answer

"which nvm" is gone

I installed NVM on an ubuntu machine, but, when I put it in the crontab for execution during reboot: @reboot nvm use 0; it didn't work, and I got a mail from the cron daemon, saying: /bin/sh: 1: nvm: not found So, I thought this a path problem,…
Erel Segal-Halevi
  • 33,955
  • 36
  • 114
  • 183
22
votes
5 answers

ng --version showing The current version of Node (16.8.0) is not supported by Angular

I just installed the latest version of node(16.8) using nvm and angular/cli(12.2). But when i run ng --version It shows the following: Warning: The current version of Node (16.8.0) is not supported by Angular. I tried to downgrade the node and …
walexy
  • 609
  • 2
  • 7
  • 16