YunYouJun/cook

pnpm dev报错

wxf26054 opened this issue · 5 comments

root@alexyang:~/cook2# pnpm dev

@ dev /root/cook2
vite --port 3333 --open

failed to load config from /root/cook2/vite.config.ts
error when starting dev server:
/root/cook2/node_modules/.pnpm/vite-plugin-inspect@0.5.0_vite@2.9.5/node_modules/vite-plugin-inspect/dist/index.cjs:68
promise?.reject(error);
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/root/cook2/vite.config.ts:38:42)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.require.extensions. [as .ts] (/root/cook2/node_modules/.pnpm/vite@2.9.5_sass@1.50.1/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:61679:20)
 ELIFECYCLE  Command failed with exit code 1.

请检查 node 版本是否大于 14。

是需要满足node>=14的版本吗?

对,14 支持 ES Module。

好的, 我试下

感谢, 解决了!