背景:手提电脑是2016年买的,用的还是win7系统,node版本从13.14.0就开始不支持win7了
踩过的坑:
问题1
一股脑安装完 @vue-cli3 后,敲入 npm run serve,会报错,点进去报错的文件,会发现使用了es6语法,所以猜测node版本可能过低,不支持es6语法,然后升级node版本
E:\Study\demos\vue-ts-demo2\node_modules\ora\index.js:401
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (E:\Study\demos\vue-ts-demo2\node_modules\@vue\cli-shared-utils\lib\spinner.js:1:75)
问题2
升级到node v13.2.0 版本,报了个新的错误。按照提示可以安装12.0.0或者大于14.0.0的版本,就是不要用13.0.0的版本,所以就继续升级呗,然后又遇到了新的问题
ERROR You are using Node v13.2.0, but vue-cli-service requires Node ^12.0.0 || >= 14.0.0.
Please upgrade your Node version.
问题3
然后本着有新的就用新的这个想法啊,升级到14.0.0后,又报错了,意思就是这个版本要win8以上才支持,于是查了一下,13.14.0后的版本就不支持win7了,芜湖
This application is only supported on Windows 8.1, Windows Server 2012 R2, or higher.This application is only supported on Windows 8.1, Windows Server 2012 R2, or higher.PS
问题4
那我降级还不行吗,然后又安装了12.0.0,又报错了,这个错还很古怪,查了一下资料,说是这个node版本不稳定
# Fatal error in , line 0
# Check failed: U_SUCCESS(status).
#
#FailureMessage Object: 000000000019D940npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
解决
所以我就找了一个稳定的12.12.0版本,因为查了LTS版本都是一些稳定性那么强的,然后大版本刚开始也不怎么稳定,所以选了中间的。然后终于可以运行了。。。。这个版本node已经支持 es6 语法和api了,然后又可以在 win7 上运行,完美解决。