【问题标题】:Nuxt deployment to Azure - cannot find module @nuxt/ufoNuxt 部署到 Azure - 找不到模块 @nuxt/ufo
【发布时间】:2022-01-07 16:15:06
【问题描述】:

我正在将 Nuxt 应用程序部署到 Azure,并且最近升级到了最新版本的 nuxt。它在本地运行,但在部署到天蓝色时我收到:

我的理解是这个模块在 2.15.x 中被删除了。我已从 azure 应用的 wwwroot 文件夹中删除了所有文件 (rm -r -d *),并从 Visual Studio Code 重新部署。

Starting deployment...
Creating zip package...
Zip package size: 53.6 MB
Fetching changes.
Cleaning up temp folders from previous zip deployments and extract
-ce0578fcc258.zip (51.17 MB) to /tmp/zipdeploy/extracted
Updating submodules.
Preparing deployment for commit id 'd3a896856e'.
Generating deployment script.
Using cached version of deployment script (command: 'azure -y --no
te/deployments/tools" --basic --sitePath "/tmp/zipdeploy/extracted
Running deployment command...
Command: "/home/site/deployments/tools/deploy.sh"
Handling Basic Web Site deployment.
Kudu sync from: '/tmp/zipdeploy/extracted' to: '/home/site/wwwroot
Copying file: 'App.vue'
Copying file: 'ecosystem.config.js'
Copying file: 'main.js'
Copying file: 'nuxt.config.js'
Copying file: 'package-lock.json'
Copying file: 'package.json'
Copying file: 'sources.info'
Copying file: 'test.env'
Ignoring: .deployment
Copying file: '.nuxt/App.js'
Copying file: '.nuxt/auth.js'
Copying file: '.nuxt/axios.js'
Copying file: '.nuxt/client.js'
Copying file: '.nuxt/cookie-universal-nuxt.js'
Copying file: '.nuxt/empty.js'
Copying file: '.nuxt/index.js'
Copying file: '.nuxt/jsonp.js'
Copying file: '.nuxt/loading.html'
Copying file: '.nuxt/middleware.js'
Copying file: '.nuxt/router.js'
Copying file: '.nuxt/router.scrollBehavior.js'
Copying file: '.nuxt/routes.json'
Copying file: '.nuxt/server.js'
Copying file: '.nuxt/store.js'
Copying file: '.nuxt/utils.js'
Copying file: '.nuxt/components/index.js'
Copying file: '.nuxt/components/nuxt-build-indicator.vue'
Copying file: '.nuxt/components/nuxt-child.js'
Copying file: '.nuxt/components/nuxt-error.vue'
Copying file: '.nuxt/components/nuxt-link.client.js'
Copying file: '.nuxt/components/nuxt-link.server.js'
Copying file: '.nuxt/components/nuxt-loading.vue'
Copying file: '.nuxt/components/nuxt.js'
Copying file: '.nuxt/components/plugin.js'
Copying file: '.nuxt/components/readme.md'
Copying file: '.nuxt/mixins/fetch.client.js'
Copying file: '.nuxt/mixins/fetch.server.js'
Copying file: '.nuxt/vetur/tags.json'
Copying file: '.nuxt/views/app.template.html'
Copying file: '.nuxt/views/error.html'
Copying file: '.nuxt/vuetify/options.js'
Copying file: '.nuxt/vuetify/plugin.js'
Copying file: 'assets/README.md'
Copying file: 'assets/logo.png'
Copying file: 'assets/variables.scss'
Copying file: 'assets/images/accessibility.jpg'
Copying file: 'assets/images/collaboration.jpg'
Omitting next output lines...
Processed 1160 files...
Processed 2537 files...
Processed 3971 files...
Processed 4957 files...
Processed 6169 files...
Processed 7610 files...
Processed 9345 files...
Processed 10695 files...
Processed 12066 files...
Processed 13778 files...
Processed 15096 files...
Processed 16553 files...
Processed 18211 files...
Processed 19594 files...
Processed 20928 files...
Processed 22606 files...
Processed 24410 files...
Processed 25672 files...
Processed 26666 files...
Processed 27857 files...
Processed 29085 files...
Finished successfully.
Running post deployment command(s)...
Triggering recycle (preview mode disabled).
Deployment successful.
completed.

我不确定为什么需要这个模块,如果它被删除了。本地没有@nuxt/ufo 文件夹(在本地运行正常)

包json:

"scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore . --fix",
    "lint": "npm run lint:js"
  },
  "dependencies": {
    "@microsoft/signalr": "^5.0.5",
    "@nuxtjs/auth-next": "^5.0.0-1610642462.1bcdc1e",
    "@nuxtjs/axios": "^5.12.2",
    "@nuxtjs/vuetify": "^1.11.2",
    "cookie-universal-nuxt": "^2.1.4",
    "core-js": "^3.6.5",
    "moment": "^2.29.1",
    "nuxt": "^2.15.8",
    "qrcode.vue": "^1.7.0",
    "vue-auth-image": "0.0.3",
    "vue-draggable-resizable": "^2.3.0",
    "vue-wordcloud": "^1.1.1"
  },
  "devDependencies": {
    "@nuxtjs/eslint-module": "^3.0.2",
    "eslint": "^8.3.0",
    "eslint-plugin-nuxt": "^3.0.0",
    "eslint-plugin-vue": "^8.1.1",
    "sass-loader": "^10.1.1",
    "webpack": "^4.46.0"
  }

还有其他值得一看的地方或可以尝试的东西吗?

更新 1

所以,我将弃用的包添加到 package.json 文件并重新部署。这突出了一个潜在的问题。内容仍然来自旧版本,但是,在 KUDO 中我可以看到那里的新内容,但该网站正在提供旧版本。如果我在 Azure 中停止该站点,它确实会停止工作,所以肯定是在正确的应用程序中等等)。这可能解释了 ufo 问题,因为如果它仍然是旧代码,那么它将在 nuxt 1.14.6 上并且仍然引用已弃用的 @nuxt/ufo 模块。

【问题讨论】:

  • 您是否在 nuxt.config.js 文件中的某处使用了 @nuxt/ufo
  • 我不这么认为,但我认为它必须在某个地方使用才能使用它。我可能会启动一个新的 nuxt 应用程序,看看它默认包含哪些引用

标签: node.js npm azure-web-app-service nuxt.js


【解决方案1】:

来自what I found,使用npm i @nuxt/ufo 安装包应该可以解决它。

关于包本身的更多细节available here

也许清理你的 node_modules 并尝试仔细检查每个依赖项是否都已解决,这也可能会有所帮助。

【讨论】:

  • 我相信它会,但关键是该包已被弃用,所以当任务点它升级包时真的不想使用它。
  • @Simon 您在哪里看到它已被弃用?
猜你喜欢
  • 2021-04-19
  • 2020-01-29
  • 2021-08-02
  • 2021-03-09
  • 2020-06-27
  • 1970-01-01
  • 1970-01-01
  • 2021-09-07
  • 2020-02-16
相关资源
最近更新 更多