YunYouJun / cook

🍲 好的,今天我们来做菜!OK, Let's Cook!
https://cook.yunyoujun.cn
MIT License
5.06k stars 318 forks source link

pnpm dev报错 #22

Closed wxf26054 closed 2 years ago

wxf26054 commented 2 years ago

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.

YunYouJun commented 2 years ago

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

wxf26054 commented 2 years ago

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

YunYouJun commented 2 years ago

对,14 支持 ES Module。

wxf26054 commented 2 years ago

好的, 我试下

wxf26054 commented 2 years ago

感谢, 解决了!