Hi. Yes, you're right, after nvm use you can execute only npm start and it will use the Node version you selected.
But actually the correct command to run npm as you were trying would be nvm exec npm start (not nvm run), maybe that's why you were getting an error? I see I have that command wrong in one of the sections of the post, I have a nvm run where a nvm exec should be (I'm going to edit that). Running the commands like this is only usefull if you have a .nvmrc file to avoid having to execute nvm use every time. But like you said, if you run nvm use, then you can actually just use the normal node and npm commands!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi. Yes, you're right, after
nvm use
you can execute onlynpm start
and it will use the Node version you selected.But actually the correct command to run npm as you were trying would be
nvm exec npm start
(notnvm run
), maybe that's why you were getting an error? I see I have that command wrong in one of the sections of the post, I have anvm run
where anvm exec
should be (I'm going to edit that). Running the commands like this is only usefull if you have a.nvmrc
file to avoid having to executenvm use
every time. But like you said, if you runnvm use
, then you can actually just use the normalnode
andnpm
commands!