log4js无法使用nodejs处理gae

时间:2017-05-16 08:29:39

标签: node.js google-app-engine log4js-node

我正在尝试使用

在谷歌应用引擎上部署节点项目
gcloud app deploy

但这是抛出错误

Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
module.js:471
    throw err;
    ^

Error: Cannot find module 'log4js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/app/server.js:38:14)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

同一个项目正在本地机器上运行。这是我的package.json

{
  "name": "myapp",
  "version": "1.0.0",
  "description": "myapp",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "dependencies": {
    "body-parser": "^1.15.0",
    "connect-timeout": "^1.8.0",
    "express": "^4.13.4",
    "generic-pool": "^2.4.2",
    "multer": "^1.2.0",
    "mysql": "^2.10.2",
    "requestify": "^0.1.17"
  }
}

问题是什么?

1 个答案:

答案 0 :(得分:1)

依赖项中缺少log4js。

npm install log4js --save将其添加到您的package.json。