1
我正在尝试使用Capistrano使用以下this教程部署角应用程序。所以在我的Capfile我有以下几点:如何使用Capistrano部署角应用程序
require 'capistrano/setup'
require 'capistrano/deploy'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
在我config/deploy
文件我有以下几点:
...
task :bower_and_npm_install do
on roles(:app), in: :sequence, wait: 5 do
within release_path do
execute :npm, "install"
execute :bower, "install"
end
end
end
after :published, :bower_and_npm_install
...
当我尝试部署我得到以下错误:
[6ff53bb3] Command: cd /home/user/apps/myapp/releases/20151015095546 && /usr/bin/env npm install
DEBUG [6ff53bb3] /usr/bin/env:
DEBUG [6ff53bb3] npm
DEBUG [6ff53bb3] : No such file or directory
我已经试过如下:
...
execute "bash -c '. /usr/bin/npm && cd #{current_path} && npm install'"
...
OR
execute "/usr/bin/npm && cd #{current_path} && npm install'"
OR
execute "cd #{current_path} && npm install'"
它没有工作。
任何想法?
它返回南版本。当我运行'which npm'时,我得到'/ usr/bin/npm'我得不到的是为什么Capistrano正在'/ usr/bin/env'上寻找节点 – WagnerMatosUK
env的原因在这里解释:http: //capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/ –
嗨请问。感谢您的回复。我之前看过那篇文章。它确实解释了原因,但没有解决问题。我拥有capistrano/node,但我相信这个模块已经过时了,它也不能工作 – WagnerMatosUK