Upgrade Npm and NodeJS using command line under Windows

Recently, I still plan to do a good job of vue.

Get started with node.js installed a long time ago. It must be updated.

 

First use the command to view the currently installed version:

node -v
npm -version

Upgrade NPM:

npm install npm -g

After the upgrade is complete, you can view the version again to determine the upgrade success.

 

Install the global n module:

npm install -g n

An error occurs after execution

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@6.4.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS:    !win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-04-08T03_59_18_138Z-debug.log

Execute the following command

npm install -g n --force

Successful installation

Then upgrade node to the latest version

n stable

Then report an error

' "bash" ' is not an internal or external command, nor is it a running program or batch file.

 

Baidu learns that it may be that Linux script is used in Windows, but Windows does not.

At last. . . I re-installed the node installation package and overlaid the installation. . . .

Tears choked.

This story tells us not to keep thinking about playing tall, the installation is over.

 

https://www.cnblogs.com/furenjian/p/9848311.html

Guess you like

Origin www.cnblogs.com/Aaxuan/p/12660130.html