问题原因: 你的电脑是win7系统,当使用node.js高于14.x版本,你的node将无法使用!
node -v
Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher. Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this check, but Node.js might not execute correctly. Any issues encountered on unsupported platforms will not be fixed.
解决方案:
使用set NODE_SKIP_PLATFORM_CHECK=1命令行将帮你解决问题
注意:不要在VScode编辑器的命令行使用,那里执行node -v依然会报错,应当在windows系统“开始”中运行CMD使用才不会报错,我不清楚原因,希望有了解的可以告诉我一下
D:>set NODE_SKIP_PLATFORM_CHECK=1
D:>node -v
v14.15.4