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