我試圖部署基於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