我是NodeJS / SailsJS的新手,我第一次尝试使用OpenShift。我的结局可能存在许多愚蠢的缺点,所以请记住我的原始技能水平。
我有一个在Heroku的免费服务上运行的SailsJS应用程序。它功能齐全并且在使用中。但是,为了尝试不同的,更复杂的平台并探索我的选择,我还想在OpenShift上部署它。
我遵循了一些教程,最终设法克隆了我的代码(来自私人仓库,我遇到了一些麻烦,提供了对OpenShift的SSH访问)并构建了。构建成功但部署/窗格显示错误。日志内容如下
Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process. Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process. npm info lifecycle wopple@0.0.1~start: Failed to exec start script npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! wopple@0.0.1 start: `node app.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the wopple@0.0.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /opt/app-root/src/.npm/_logs/2018-04-14T18_38_59_717Z-debug.log
日志文件:
0 info it worked if it ends with ok
1 verbose cli [ '/opt/rh/rh-nodejs8/root/usr/bin/node',
1 verbose cli '/opt/rh/rh-nodejs8/root/usr/bin/npm',
1 verbose cli 'run',
1 verbose cli '-d',
1 verbose cli 'start' ]
2 info using npm@5.6.0
3 info using node@v8.9.4
4 verbose config Skipping project config: /opt/app-root/src/.npmrc. (matches userconfig)
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info lifecycle wopple@0.0.1~prestart: wopple@0.0.1
7 info lifecycle wopple@0.0.1~start: wopple@0.0.1
8 verbose lifecycle wopple@0.0.1~start: unsafe-perm in lifecycle true
9 verbose lifecycle wopple@0.0.1~start: PATH: /opt/rh/rh-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/node-gyp-bin:/opt/app-root/src/node_modules/.bin:/opt/rh/rh-nodejs8/root/usr/bin:/opt/app-root/src/node_modules/.bin/:/opt/app-root/src/.npm-global/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle wopple@0.0.1~start: CWD: /opt/app-root/src
11 silly lifecycle wopple@0.0.1~start: Args: [ '-c', 'node app.js' ]
12 silly lifecycle wopple@0.0.1~start: Returned: code: 1 signal: null
13 info lifecycle wopple@0.0.1~start: Failed to exec start script
14 verbose stack Error: wopple@0.0.1 start: `node app.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/opt/rh/rh-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/
npm-lifecycle/index.js:285:16)
14 verbose stack at emitTwo (events.js:126:13)
14 verbose stack at EventEmitter.emit (events.js:214:7)
14 verbose stack at ChildProcess.<anonymous> (/opt/rh/rh-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/
npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack at emitTwo (events.js:126:13)
14 verbose stack at ChildProcess.emit (events.js:214:7)
14 verbose stack at maybeClose (internal/child_process.js:925:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid wopple@0.0.1
16 verbose cwd /opt/app-root/src
17 verbose Linux 3.10.0-693.15.2.el7.x86_64
18 verbose argv "/opt/rh/rh-nodejs8/root/usr/bin/node" "/opt/rh/rh-nodejs8/root/usr/bin/npm" "run" "-d" "start"
19 verbose node v8.9.4
20 verbose npm v5.6.0
21 error code ELIFECYCLE
22 error errno 1
23 error wopple@0.0.1 start: `node app.js`
23 error Exit status 1
24 error Failed at the wopple@0.0.1 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
我相信这里有足够的OpenShift专业人士来帮助解决这个问题。如果需要从代码中共享其他内容,请发表评论。
提前致谢!