简体   繁体   English

部署到Azure Web应用后,某些模块不会自动安装

[英]After deploying to Azure Web apps, some modules are not automatically installed

After deploying to Azure Web apps, some modules are not automatically installed. 部署到Azure Web应用程序后,不会自动安装某些模块。

After deploying, the following error is output. 部署后,将输出以下错误。

Error: Can not find module 'Cookie-parser'

At that time, I run 'npm install cookie-parser --save'. 当时,我运行“ npm install cookie-parser --save”。

In the package.json, the dependencies of the cookie-parser is surely saved. 在package.json中,肯定会保存cookie解析器的依赖项。

{
  "name": "solo",
  "description": "demo",
  "version": "0.0.1",
  "private": true,
  "license": "MIT",
  "author": "lostsupervisor",
  "engines": {
     "node": ">=6.9.1"
  },
  "dependencies": {
     "body-parser": "^1.17.2",
     "cookie-parser": "^1.4.3",
     "ejs": "^2.5.6",
     "express": "^4.15.4",
     "express-session": "^1.15.4",
     "mssql": "^4.0.4",
     "tedious": "^2.0.0"
  },
  "scripts": {
     "start": "node index.js"
  } 
}

However, the same event occur after deploying next time. 但是,下一次部署后,会发生同一事件。

Could you teach me a solution? 你能教我一个解决方案吗?

You are using Cookie-parser which is wrong. 您正在使用Cookie-parser ,这是错误的。

In NPM modules while downloading npm upper and lower cases matter. 在NPM模块,而不管下载NPM 大小写 Change it to cookie-parser , upper C is causing the problem. 将其更改为cookie-parser ,上面的C引起了问题。

It was caused by package-lock.json being not being pushed. 这是由于未推送package-lock.json引起的。 I solved it by pushing it. 我通过推动解决了它。 Thank you very much. 非常感谢你。

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

相关问题 在Azure Web应用程序站点上使用msnodesql部署节点应用程序失败 - Deploying a node app using msnodesql fails on azure Web apps site AZURE Web应用程序:从Github存储库部署Angular SPA和Node Express服务器 - AZURE Web Apps: deploying Angular SPA & Node Express server from Github repository Azure“Web apps”服务:从package.json自动安装npm模块 - Azure “Web apps” service: auto-install npm modules from package.json 将客户端和服务器Node.js应用程序部署到Azure - Deploying client and server nodejs apps to Azure 将角度应用程序部署到Azure门户网站Web应用程序后如何解决“无法加载资源404” - How to fix “Failed to load resource 404” after deploying angular application to azure portal web app 需要一些有关部署/托管 Web 应用程序的指导 - Need some guidance on deploying/hosting a web app 在Azure Web Services上部署Node JS应用程序 - Deploying Node JS application on Azure Web Services 在azure上将前端和后端部署到同一Web服务 - deploying frontend and backend to the same web service on azure 使用Web套接字将网站部署到Windows Azure - Deploying a website to windows azure with web sockets 部署 Azure 应用服务时无法安装节点模块 - Cannot install node modules when deploying Azure App Service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM