You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nuxt 3.0稳定版执行npm run generate报Unexpected token错误求助

Nuxt 3.0稳定版执行npm run generate报错问题

执行npm run generate命令时出现如下错误:
错误截图

该命令用于生成Nuxt.js静态站点,此前使用Nuxt 3 RC版本时可正常构建,升级至Nuxt 3.0稳定版后出现此问题。

项目的package.json内容如下:

{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "start": "nuxt dev",
    "generate": "nuxt generate ",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare",
    "vite:build": "vite build"
  },
  "devDependencies": {
    "@fortawesome/free-brands-svg-icons": "^6.2.0",
    "@fortawesome/free-solid-svg-icons": "^6.2.0",
    "@nuxt/postcss8": "^1.1.3",
    "@nuxtjs/fontawesome": "^1.1.2",
    "@nuxtjs/tailwindcss": "^5.3.3",
    "@tailwindcss/forms": "^0.5.3",
    "autoprefixer": "^10.4.13",
    "nuxt": "3.0.0",
    "postcss": "^8.4.19",
    "tailwindcss": "^3.2.4"
  },
  "dependencies": {
    "@a1ter/nuxt-auth-aws-cognito-scheme": "^0.0.12",
    "@headlessui/vue": "^1.4.2",
    "@mdi/js": "^7.0.96",
    "@nuxtjs/auth-next": "^5.0.0-1637745161.ea53f98",
    "@pinia/nuxt": "^0.4.2",
    "amazon-cognito-identity-js": "^5.2.10",
    "aws-amplify": "^4.3.21",
    "chart.js": "^3.9.1",
    "numeral": "^2.0.6",
    "pinia": "^2.0.22",
    "readable-stream": "^4.2.0",
    "rollup-plugin-node-polyfills": "^0.2.1"
  }
}

内容的提问来源于stack exchange,提问作者Muhammad Afzaal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 21:45:33