可以再nvm对应版本中查看npm是否有对应的文件或者node_modules文件夹是否存在文件
没有即说明npm没下载。
$ npm i
npm ERR! Unexpected token '.'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxx\AppData\Local\npm-cache\_logs\2023-04-21T08_39_13_704Z-debug-0.log
PS E:\xx\code\egg-example>
PS C:\Windows\system32> nvm install 18.16.0
Downloading node.js version 18.16.0 (64-bit)...
Complete
Downloading npm version 9.5.1... Error while downloading https://github.com/npm/cli/archive/v9.5.1.zip - Get https://github.com/npm/cli/archive/v9.5.1.zip: net/http: TLS handshake timeout
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x5c6eb0]
。。。。。
PS C:\Windows\system32> nvm list
解决:在node官网下载对应版本https://nodejs.org/zh-cn/download/releases
下载解压到nvm对应版本的文件夹