signpost
- NVM-windows
- mirror source disposed nvm
- nvm use during pit
- nvm successful installation, node installation was successful, able to work, but an error when using npm
Applicable scene
Took over the ancestral old code, node version is too high lead to not run successfully. Or at the same time you need to use multiple versions node.
surroundings
windows 10 64bit
Reference blog
Rain Pro Lewis - under Windows to completely uninstall and install node.js node.js multi-version management tool nvm-windows
Bud XQ - after the next node npm install windows nvm command can not find solutions to problems
background
Does not specify the version of the tutorial environment and bullying , when just getting started with a new technology or a new framework, we often go to the search hellow world tutorial others, but it is a gas, follow the steps in any case is unsuccessful ,
in a kind of pit I came across different environments and are basically caused by ..... version (in addition to the Internet and related)
For example, a project two years ago Angular took over recently to see a predecessor Square tutorial on Ethernet, and still have not climbed out of the pit. Benpian is an article on the front Ethernet workshop of the article, because it needs a tutorial using an older version node.
Thinking
- Uninstall node
- Delete residual path and file
- Installation nvm-windows
- Mirroring group
step
- Uninstall the existing system node (if any)
Based here after the next node npm install windows nvm command can not find solutions to problems , simplify and improve on this basis.
- Uninstall node in uninstaller
- Delete all associated with the node's path (either user-level or system level) in environment variables
- Delete the following file path (may be only part of the file)
C: \ Program Files (x86) \ nodejs
C: \ Program Files \ nodejs
C: \ the Users the User {} \ AppData \ Roaming \ npm
C: \ the Users} {the User \ AppData \ Roaming \ Cache NPM-
C: \ the Users the User {} \ the node_modules (path on my computer)
- Download and install the latest version nvm nvm-setup.zip
- Replace the source image
in路径 C:\Users\{User}\AppData\Roaming\nvm\settings.txt
the following two addnode_mirror: https://npm.taobao.org/mirrors/node/ npm_mirror: https://npm.taobao.org/mirrors/npm/
At this point, if you look closely, you will find
C:\Program Files
under nodejs ask every family is actually a shortcut points to the installation path nvm theC:\Users\i353667\AppData\Roaming\nvm
corresponding next node version. - nvm use
# get available node version list nvm list available # install specific node version you need nvm install The_Version_You_Need # list the node you have installed in your PC nvm list # switch node version you need nvm use The_Version_You_Need
Error Handling
Common Mistakes solutions on Windows nvm the basic can search, I did not have a special column about the retrieved here.
-
Phenomenon: nvm install the specified version of the node, and switch after using the normal instruction node, for example
node --version
, but using thenpm
instruction error, and error based on node version will be different, but basically are npm found. At this point if you openC:\Users\{User}\AppData\Roaming\nvm\v9.11.1\node_modules
and found no npm folder, and that is the problem. - Solutions
uninstall your current version and re-install. Sometimes I repeat twice before success, a success flag is node_modules folder npm folder appears, or command line call npm not being given.
####
For more Haytham original articles, please pay attention to the public number "Xuju Long":