有npm直接执行npm install --save-dev @types/node
没有npm的在拓展搜npm,安装微软弃用的那个(如下)
重置代理:npm config set proxy null
切换淘宝源:npm config set registry https://registry.npmmirror.com
然后再执行:npm install --save-dev @types/node
成功后当前目录下会出现以下三个文件:
此方法实现的补全只在当前目录下有效,切换其他目录或删除以上三个文件后需要重新操作