简体   繁体   English

通过 Github 操作将 node.js 部署到 azure web 应用程序,由于我引用的一些错误和下面的屏幕截图,我的构建一直失败。 请与泰

[英]Deploying node.js to azure web app Via Github Actions, I keep failing my build due to some error that i quoted and screenshot below. Please & Ty

["npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! ["npm WARN read-shrinkwrap 这个版本的npm是和lockfileVersion@1兼容的,但是package-lock.json是为lockfileVersion@2生成的。我会努力做到最好的!

core-js@3.21.1 postinstall /home/runner/work/team-mario-p2-frontend/team-mario-p2-frontend/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}" core-js@3.21.1 postinstall /home/runner/work/team-mario-p2-frontend/team-mario-p2-frontend/node_modules/core-js node -e "try{require('./postinstall') }赶上(e){}”

core-js-pure@3.21.1 postinstall /home/runner/work/team-mario-p2-frontend/team-mario-p2-frontend/node_modules/core-js-pure node -e "try{require('./postinstall')}catch(e){}" core-js-pure@3.21.1 postinstall /home/runner/work/team-mario-p2-frontend/team-mario-p2-frontend/node_modules/core-js-pure node -e "try{require('. /postinstall')}catch(e){}"

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):

在此处输入图像描述

Most likely your problem is that you're using different npm versions locally and in actions.您的问题很可能是您在本地和操作中使用了不同的 npm 版本。

If this is the issue, then you can resolve it by specifying a different node version with the setup-node action .如果这是问题所在,那么您可以通过使用setup-node 操作指定不同的节点版本来解决它。 For example, specifying node 16 means you'll get npm 8.例如,指定节点 16 意味着您将获得 npm 8。

Specifying node 12, on the other hand, will lead to npm 6. npm 6 is also what causes lockfile version 1 while npm 8 uses lockfile version 2.另一方面,指定节点 12 将导致 npm 6。npm 6 也是导致锁定文件版本 1 而 npm 8 使用锁定文件版本 2 的原因。

Sample:样本:

uses: actions/setup-node@v3
with:
  node-version: 16

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Static Web 通过 GitHub 部署的应用程序 (.yml) 在私有 npm 包上出现 404 错误 - Azure Static Web App deploying via GitHub Actions (.yml) errors with 404 on private npm packages 使用 Github 操作将 Next.js 部署到 Azure 应用程序服务时出现问题 - Problem with Deploying Next.js to Azure App Service using Github Actions 部署 Firebase 和 Node.js 应用程序导致错误:Error: Parse Error in remoteconfig.template.json: Unexpected token 'i' at 1:1 - Deploying Firebase and Node.js application results in error: Error: Parse Error in remoteconfig.template.json: Unexpected token 'i' at 1:1 如何从 Visual Studio 2019 将 Node.js 应用部署到 Azure 应用服务? - How do I deploy a Node.js app to a Azure App Service from Visual Studio 2019? 为什么我的示例应用程序 Elastic Beanstalk + Node.js 总是失败? - Why is my sample application Elastic Beanstalk + Node.js keep failing? 将 .NET 核心控制台应用程序部署到 Azure 后加载我的 web 应用程序时出错 - Error loading my web app after deploying .NET Core console app to Azure npm CI && npm run build 在 github 操作中失败,我正在使用 firebase 部署项目 - npm CI && npm run build is failing in github actions, I'm using firebase to deploy the project 错误 GitHub 操作部署到 Azure Web 应用程序 - Error with GitHub Action Deploy to Azure Web App 通过Github部署Django App到Azure时禁用collectstatic命令 - Disable collectstatic command when deploying Django App to Azure via Github 无论我做什么,Node.js 中都会出现“ConfigError:Missing region in config”错误 - Keep getting the "ConfigError: Missing region in config" error in Node.js no matter what I do
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM