vite + vu3 + ts 项目,npm run build 报错-CSDN博客

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

新建了vite 项目build的时候报错 

npm ERR! demo1@0.0.0 build: `vue-tsc && vite build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo1@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

> demo1@0.0.0 build E:\learn\demo1\demo1
> vue-tsc && vite build

E:\learn\demo1\demo1\node_modules\@vue\language-core\out\generators\template.js:261
                        tagOffsetsMap[tag] ??= [];
                                           ^^^

SyntaxError: Unexpected token '??='
    at wrapSafe (internal/modules/cjs/loader.js:1001:16)
    at Module._compile (internal/modules/cjs/loader.js:1049:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (E:\learn\demo1\demo1\node_modules\@vue\language-core\out\index.js:30:14)    
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo1@0.0.0 build: `vue-tsc && vite build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo1@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.     

npm ERR! A complete log of this run can be found in:

 这个报错是 node 版本问题一查 版本是 14.21.1 的换成 16.0.0 的 问题解决

这里更换 node 版本 强烈建议 使用 NVM 工具切换 node 版本贼快再也不用像之前那样 卸载node重装啦

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6