尝试在Google App Engine上部署node.js时出错 [英] Error when trying to deploy node.js on Google App Engine
问题描述
在尝试将 Node.js
应用程序部署到Google App Engine时出现错误。 Node.js
运行时使用require语句崩溃。什么是我的错?
目录结构:
$ b | --app < br>
--- protocol.js
app.js .....
在文件app.js中
.....
var protocol = require('./ app / protocol') ;
....
使用gcloud进行部署时:
gcloud app deploy app.yaml
然后错误:
> nodejs-getting-started@1.0.0 start / app
>节点app.js
module.js:471
throw err;
^
错误:无法在Function.Module._resolveFilename(module.js:469:15)处找到模块'./app/protocol'
at Function .Module._load(module.js:417:25)
at Module.require(module.js:497:17)
at require(internal / module.js:20:19)
在Object。< anonymous> (/app/app.js:21:16)
在Module._compile(module.js:570:32)
在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)
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv/ nodejs / bin / node/ nodejs / bin / npmstart
npm ERR!节点v6.9.2
npm ERR! npm v3.10.9
npm ERR!代码ELIFECYCLE
npm ERR! nodejs-getting-started@1.0.0 start:`node app.js`
npm ERR!退出状态1
npm ERR!
npm ERR!在nodejs-getting-started@1.0.0启动脚本'node app.js'失败。
npm ERR!确保安装了最新版本的node.js和npm。
npm ERR!如果这样做,这很可能是nodejs-getting-started软件包的问题,
npm ERR!而不是npm本身。
npm ERR!告诉作者这在你的系统上失败了:
npm ERR!节点app.js
npm ERR!您可以通过以下链接获取有关如何为此项目打开问题的信息:
npm ERR! npm错误nodejs-getting-started
npm ERR!或者如果没有,您可以通过以下方式获取他们的信息:
npm ERR! npm owner ls nodejs-getting-started
npm ERR!上面可能还有其他日志记录输出。
错误报告给Google SDK问题报告,
https://code.google.com/p/google-cloud-sdk/issues/detail?id=1431
已解决通过降级到137.0.1
gcloud组件更新--version = 137.0.1
并重做该过程。
I am getting errors when trying to deploy Node.js
app to Google App Engine. Node.js
run time get crashed with require statement. What am I wrong?
Directory structure:
|--app
---protocol.js
app.js .....
In file app.js
.....
var protocol = require('./app/protocol');
....
When deploying with gcloud:
gcloud app deploy app.yaml
then errors:
> nodejs-getting-started@1.0.0 start /app
> node app.js
module.js:471
throw err;
^
Error: Cannot find module './app/protocol'
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/app.js:21:16)
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)
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! nodejs-getting-started@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs-getting-started@1.0.0 start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nodejs-getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nodejs-getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nodejs-getting-started
npm ERR! There is likely additional logging output above.
The error was reported to the google SDK issue reporting,
https://code.google.com/p/google-cloud-sdk/issues/detail?id=1431
It was solved by downgrading to 137.0.1
gcloud components update --version=137.0.1
and redoing the process.
这篇关于尝试在Google App Engine上部署node.js时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!