0

我正在测试一个小想法,即在 CloudFoundry 上有一个 node.js 脚本来在另一个 FTP 站点中写入文件。

var Ftp = require("jsftp");

var ftp = new Ftp({
    host: "ftp.somesite.com",
    user: "username",
    port: 21, 
    pass: "password"
});

var remotePath = "/test.txt";

var data = 'this is a test string';

ftp.getPutSocket(remotePath, function(err, socket) {
    socket.write(data, function(err) {
        console.log('good');
        socket.end();
    });
});

但是,当我这样做时,vmc push我得到了这个错误

Uploading my-ftp... FAILED
Upload failed. Try again with 'vmc push'.
Errno::ENOENT: No such file or directory - C:/Users/myUsername/AppData/Local/Temp/.
vmc_my-ftp_files/node_modules/jsftp/test/test_c9/??.md
For more information, see ~/.vmc/crash

crash文件也没有告诉我太多:

Errno::ENOENT: No such file or directory - C:/Users/myUsername/AppData/Local/Temp/.vmc_my-ftp_files/node_modules/jsftp/test/test_c9/??.md

cfoundry-0.4.14/lib/cfoundry/upload_helpers.rb:146:in `size'
cfoundry-0.4.14/lib/cfoundry/upload_helpers.rb:146:in `block in make_fingerprints'
cfoundry-0.4.14/lib/cfoundry/upload_helpers.rb:143:in `glob'
cfoundry-0.4.14/lib/cfoundry/upload_helpers.rb:143:in `make_fingerprints'
cfoundry-0.4.14/lib/cfoundry/upload_helpers.rb:125:in `determine_resources'
cfoundry-0.4.14/lib/cfoundry/upload_helpers.rb:44:in `upload'
vmc-0.4.7/lib/vmc/cli/app/push.rb:119:in `block in upload_app'
interact-0.5.0/lib/interact/progress.rb:98:in `with_progress'
vmc-0.4.7/lib/vmc/cli/app/push.rb:118:in `upload_app'
vmc-0.4.7/lib/vmc/cli/app/push.rb:100:in `setup_new_app'
vmc-0.4.7/lib/vmc/cli/app/push.rb:82:in `push'
mothership-0.3.5/lib/mothership/base.rb:61:in `run'
mothership-0.3.5/lib/mothership/command.rb:68:in `block in invoke'
manifests-vmc-plugin-0.4.19/lib/manifests-vmc-plugin/plugin.rb:113:in `call'
manifests-vmc-plugin-0.4.19/lib/manifests-vmc-plugin/plugin.rb:113:in `block (2 levels) in <class:Manifests>'
mothership-0.3.5/lib/mothership/callbacks.rb:74:in `with_filters'
manifests-vmc-plugin-0.4.19/lib/manifests-vmc-plugin/plugin.rb:112:in `block in <class:Manifests>'
mothership-0.3.5/lib/mothership/command.rb:78:in `instance_exec'
mothership-0.3.5/lib/mothership/command.rb:78:in `block (2 levels) in invoke'
mothership-0.3.5/lib/mothership/command.rb:82:in `instance_exec'
mothership-0.3.5/lib/mothership/command.rb:82:in `invoke'
mothership-0.3.5/lib/mothership/base.rb:50:in `execute'
vmc-0.4.7/lib/vmc/cli.rb:106:in `execute'
mothership-0.3.5/lib/mothership.rb:45:in `start'
vmc-0.4.7/bin/vmc:11:in `<top (required)>'
C:/Ruby193/bin/vmc:23:in `load'
C:/Ruby193/bin/vmc:23:in `<main>'

知道我做错了什么吗?它在本地主机上运行良好。

4

2 回答 2

2

我已经尝试过了,它似乎上传正常。对于节点应用程序,我总是小心确保我的 packages.json 文件中的内容与 node_modules 的内容相匹配。可以肯定的是,在尝试推送之前,完全删除 node_modules 并重新运行“npm install”。

此外,由于这似乎不是基于 http 的应用程序,请记住通过为框架选择“其他”然后选择“独立”来将框架设置为独立。

于 2012-12-18T14:10:43.927 回答
0

正确的答案是删除 node_modules/jsftp 中的 'test' 文件夹

于 2012-12-31T20:30:08.960 回答