```ruby
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
```

Use execute rather than run
user
```ruby
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
```
assistant