namespace :nodejs do

  desc 'Install node packages in shared directory'
  task :install_packages do
    run "ln -s #{shared_path}/node_modules #{release_path}/node_modules"
    run "cd #{release_path} && npm install --loglevel warn"
  end

end

namespace :nodejs do

  desc 'Install node packages in shared directory'
  task :install_packages do
    execute :ln, '-s', "#{shared_path}/node_modules", "#{release_path}/node_modules"
    execute "cd #{release_path} && npm install --loglevel warn"
  end

end

Use execute rather than run
Use execute rather than run
