我正在尝试通过 bitbucket 在 Azure webapp 上部署我的 node.js 应用程序。
当我检查 kudu 控制台上的 wwwroot 文件夹时,我找不到任何 node_modules 文件夹,因此应用程序无法启动
我已经在 kudu 控制台(在 wwwroot 文件夹内)中尝试了 npm install 和 npm install --production,我可以看到 node_modules 和文件正在通过 filezilla 安装....但是当我尝试再次启动应用程序时,node_modules只是消失了,在 kudu 控制台和 filezilla 中都看不到它。
项目文件夹中的 package.json 文件:
{
"name": "fo",
"version": "1.0.0",
"description": "xx xx xx",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "xx xx",
"license": "MIT",
"dependencies": {
"angular-map-it": "0.0.20",
"angular-maps": "^6.0.1",
"angular-waypoints": "^2.0.0",
"axios": "^0.19.0",
"bcrypt": "^3.0.6",
"bluebird": "^3.5.5",
"body-parser": "^1.19.0",
"connect-mongodb-session": "^2.2.0",
"convert-json": "^0.5.0",
"csvtojson": "^2.0.10",
"dotenv": "^8.0.0",
"express": "^4.17.1",
"express-session": "^1.16.2",
"fixed-width-string": "^1.0.0",
"guid": "0.0.12",
"json2csv": "^4.5.2",
"jsontoxml": "^1.0.1",
"moment": "^2.24.0",
"moment-business-days": "^1.1.3",
"money": "^0.2.0",
"mongoose": "^5.6.4",
"multer": "^1.4.1",
"ng-storage": "^0.3.2",
"node-crisp-api": "^1.8.3",
"nodemailer": "^6.3.0",
"objects-to-csv": "^1.0.1",
"open-exchange-rates": "^0.3.0",
"sanitize": "^2.1.0",
"svg-assets-cache": "^1.1.3"
}
}
我不明白,人们如何让 node.js 应用程序在 azure 上运行?为什么 node_modules 正在消失?为什么 azure 不会根据我的 package.json 自动安装它们?