我正在尝试在this教程之后使用Capistrano部署Angular应用。所以在我的Capfile中我有以下内容:
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'"
并没有奏效。
有什么想法吗?
答案 0 :(得分:1)
这意味着NPM未安装在服务器上或不在部署用户的路径中。
如果你进入服务器并运行npm --version
,它会返回任何内容吗?