Skip to content

Instantly share code, notes, and snippets.

@rajeshpv
Last active May 31, 2019 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajeshpv/1e5ad771532e272ae058a2e228dd4666 to your computer and use it in GitHub Desktop.
Save rajeshpv/1e5ad771532e272ae058a2e228dd4666 to your computer and use it in GitHub Desktop.
NVM on windows 10 even having admin prev, did not work for me, The Issue is, nvm installs node, but fails at npm for that new node version.

Install NVM and NodeJs

cd %USERPROFILE%\Downloads
jar xf nvm-setup.zip
cd nvm-setup
nvm-setup.exe
# input install path in wizard as 
# for nvm C:\Users\rajesh.pradeshik\programs\nvm
# for nodejs C:\Users\rajesh.pradeshik\programs\nodejs
# open new prompt and test
nvm version

# installing 8.11.3, setting  it to use as default, check if npm_modules are installed, if not getting npm manually
nvm install 8.11.3
nvm use 8.11.3

node -v
# It is npm -v gives error, since nvm install fails to install NPM package/bin alone
npm -v 
#will give error, continue as follows to fix

# download into %USERPROFILE%\Downloads from https://nodejs.org/dist/v8.11.3/node-v8.11.3-win-x64.zip
node -v > temp.txt
set /p INSTALL_NODE_VNUM=<temp.txt
echo %INSTALL_NODE_VNUM%

cd %USERPROFILE%\Downloads
jar xf node-%INSTALL_NODE_VNUM%-win-x64.zip
xcopy %USERPROFILE%\Downloads\node-%INSTALL_NODE_VNUM%-win-x64\*.* %NVM_HOME%\%INSTALL_NODE_VNUM% /K /D /H /Y /S /E

#now test both node and npm
node -v
npm -v 

# Run required packages for our project
npm install -g @angular/cli@6.0.8 rimraf@2.6.2 xvfb-maybe@0.2.1 typescript

# if you want to make 8.11.3 as default you can use as
nvm alias default 8.11.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment