我试图部署基于Deployd(deployd.com)的node.js应用程序。当通过“af update myapp”进行部署时,出现以下错误:在Appfog上部署基于Deployd(deployd.com)的Node.js应用程序
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (2K): OK
Push Status: OK
Stopping Application 'myapp': OK
Staging Application 'myapp': OK
Starting Application 'myapp': .
Error: Application [myapp] failed to start, logs information below.
====> /logs/staging.log <====
# Logfile created on 2013-07-23 15:18:29 +0000 by logger.rb/25413
Skipping npm support: npm-shrinkwrap.json is not provided
====> /logs/stderr.log <====
module.js:340
throw err;
^
Error: Cannot find module 'deployd'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/mnt/var/vcap.local/dea/apps/myapp-0- cd2bdee578441089a86b3b0331a96cd5/app/index.js:1:77)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
因此,似乎Deployd模块存在问题。我宣布它在的package.json文件:
{
"name": "myapp-test-deployd",
"version": "0.0.1",
"dependencies": {
"deployd": "0.6.10"
},
"engines": {
"node": "0.10.x",
"npm": "1.2.x"
}
}
我试图安装它: NPM安装-d
或者: NPM安装deployd
,但我得到了同样的错误。我不明白为什么这个模块不适用于Appfog。它在本地工作·
谢谢。
日志(最后一部分,这对我来说似乎是有趣的)运行 时须藤NPM安装deployd --save
在子目录中,我得到: NPM HTTP ...等等] NPM HTTP 304 https://registry.npmjs.org/stack-trace NPM HTTP 304 https://registry.npmjs.org/delayed-stream/0.0.5 NPM HTTP 304 https://registry.npmjs.org/ini NPM HTTP GET https://registry.npmjs.org/tinycolor NPM HTTP GET https://registry.npmjs.org/options NPM HTTP 304 https://registry.npmjs.org/tinycolor NPM HTTP 304 https://registry.npmjs.org/options
> [email protected] install /home/me/Development/myapp-deployd-test /node_modules/deployd/node_modules/socket.io/node_modules/socket.io- client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/me/Development/myapp-deployd-test/node_modules/deployd/node_modules/socket.io/node_modules/socket.io- client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/home/me/Development/myapp-deployd-test/node_modules/deployd/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
[email protected] ../node_modules/deployd
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
我遵循了你建议的步骤,但我得到了同样的错误。我注意到,当我在子目录中输入“sudo npm install -d”时,node_modules没有创建,所以我从根目录拷贝了它... – user2047330
@ user2047330:然后,我需要看看你的电脑,因为这确实是一个问题。因为如果npm不在根模块中安装,那么我们有问题。 –
当我执行建议的命令时,它似乎一切正常,因为我得到任何错误,并且终端日志看起来像是否已安装。但在子目录中,node_modules文件夹不出现。顺便说一下,正如我在下面评论的那样,如果没有SUDO,我不能执行这些命令,是否与问题有关?我遵循该指南(什么,没有sudo?http://foohack.com/2010/08/intro-to-npm/),但即使介绍了那里提到的命令,我不能执行npm命令没有SUDO – user2047330