[Pit situation] - Windows upgrades the latest version of node to report an error [npm install -gn]

I originally downloaded a vue-cli, and then the technology changed with each passing day, and told me to upgrade my node to 8 or above (currently v6.1.13)

Upgrade to upgrade, upgrade to report an error

 

  1. Try the first method, the most popular method on the Internet, and it is estimated that it is also the most successful one (if I succeeded, I don't need to write this article)
1  1. The first step
 2  npm -g install n
 3  2. The second step
 4  n stable (update to the latest stable version)
 5  
6  comes with common commands
 7  n //All installed versions will be listed for you to switch
 8  
9  n latest //install the latest version
 10  
11  n stable //install the latest stable version
 12  
13  n lts //install the latest long-term support version
 14  
15  n rm [version number] //delete a certain version
 16  
17 n -h //help command

 

If you report such an error

 

Then run it like this

npm install -g n --force

 

 If this error is reported after running

I clear the cache and try again

 

Then congratulations on most of the methods you can use, you can't~~~ (thorns are not exciting)

Anyway, I still can't find the reason

If this method does not work, I personally recommend downloading the latest stable version from the official website and then overwriting the installation... (I personally test it)

Come on, let's walk through the node installation process

Quietly tell you, check the path where node has been installed before overwriting: where node

Desperate, I actually installed it on the c drive

After overwriting the installation, check the environment variables

then run node -v

 

 Very nice.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325329491&siteId=291194637