Somehow today when I tried to create a new Nuxt 3 project using npx nuxi init <project name> as usual. The terminal gave me a long error when I tried to install the dependencies using npm install. I also tried deleting the lock file and using yarn & pnpm instead, however, the result is still the same.

Versions:

  • Windows: Windows_NT 10.0.19044
  • Node: v16.13.0
  • Npm: v9.0.1
  • Nuxt: 3.3.1

Error Message:

Ă— ClientCompiled with some errors in 9.90s( ) ServerHash: 2c24c5888bf3b1c1c416 13:31:53Version: webpack 4.46.0Time: 9899msBuilt at: 15/03/2023 1:31:53 pmAsset Size Chunks Chunk Names0f675ac.js 2.29 KiB 2 [immutable] runtime12a4221.js 4.75 KiB 4 [immutable]1ab12b9.js 44.4 KiB 0 [immutable] app393869b.js 184 KiB 3 [immutable] vendors/appLICENSES 336 bytesec6d84d.js 72.1 KiB 1 [immutable] commons/appEntrypoint app = 0f675ac.js ec6d84d.js 393869b.js 1ab12b9.jsWARNING in ./.nuxt/router.js 19:8-14"export 'default' (imported as 'Router') was not found in 'vue-router'@ ./.nuxt/index.js@ ./.nuxt/client.js@ multi ./.nuxt/client.jsWARNING in ./.nuxt/router.js 34:19-25"export 'default' (imported as 'Router') was not found in 'vue-router'@ ./.nuxt/index.js@ ./.nuxt/client.js@ multi ./.nuxt/client.js// The WARNING continues for about 20 more items//...//...ERROR in ./node_modules/vue-router/dist/vue-router.mjs 2157:18-26Can't import the named export 'computed' from non EcmaScript module (only default export is available)@ ./.nuxt/router.js@ ./.nuxt/index.js@ ./.nuxt/client.js@ multi ./.nuxt/client.jsERROR in ./node_modules/vue-router/dist/vue-router.mjs 2158:30-38Can't import the named export 'computed' from non EcmaScript module (only default export is available)@ ./.nuxt/router.js@ ./.nuxt/index.js@ ./.nuxt/client.js@ multi ./.nuxt/client.js// The ERROR continues for about 20 more items.//...//...ERROR Nuxt build error 13:31:53at WebpackBundler.webpackCompile (C:\Users\user\node_modules\@nuxt\webpack\dist\webpack.js:2127:21)at processTicksAndRejections (node:internal/process/task_queues:96:5)at async WebpackBundler.build (C:\Users\user\node_modules\@nuxt\webpack\dist\webpack.js:2076:5)at async Builder.build (C:\Users\user\node_modules\@nuxt\builder\dist\builder.js:327:5)at async Object.invoke (/C:/Users/user/projects/noah2/node_modules/nuxi/dist/chunks/prepare.mjs:45:5)at async _main (/C:/Users/user/projects/noah2/node_modules/nuxi/dist/cli.mjs:49:20)npm ERR! code 1npm ERR! path C:\Users\user\projects\noah2npm ERR! command failednpm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c nuxt preparenpm ERR! A complete log of this run can be found in:npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2023-03-15T05_31_37_102Z-debug-0.log

That's all for my questions. Super thanks in advance!

1

Best Answer


Downgrading nuxt to 3.2.0 and using pnpm works for me.

this is my package.json

{"private": true,"scripts": {"build": "nuxt build","dev": "nuxt dev","generate": "nuxt generate","preview": "nuxt preview","postinstall": "nuxt prepare"},"devDependencies": {"nuxt": "3.2.0"}}