tricknotes / ember-cli-rails

Unify your EmberCLI and Rails Workflows
http://thoughtbot.github.io/ember-cli-rails/
MIT License
713 stars 205 forks source link

node module not found during asset precompile. npm install not happening? #478

Open electricgraffitti opened 8 years ago

electricgraffitti commented 8 years ago

Mac OSX (local) Ubuntu 14.04 (server) Ruby 2.2 NPM 2.15.1 Ember CLI 2.7 Rails 3.2.22 EmberCLIRails 0.7.4

EmberCli.configure do |c|
  c.app :msmlms, path: 'msmlms'
end
<%= render_ember_app :msmlms do |head, body| %>
  <% head.append do %>
    <%= csrf_meta_tags %>
  <% end %>
<% end %>

Capistrano

When deploying using Capistrano, during asset precomp, I get this error

Notice: /Exec[bundle exec rake assets:precompile]/returns: Error: Cannot find module 'resolve'

Its coming from the node_module ember-cli/bin/ember:7:15

My local app has the resolve module and everything works great. So Im not sure why this is failing. Should it not have the resolve package if its running npm install during asset precomp?

Also, I dont see anywhere during deploy in the console where it run NPM Install.

Also in my dev.rb in the config/deploy

I have this path set that points to the nvm install on the server.

set :default_env, {
  "PATH" => "/home/rails/.nvm/versions/node/v0.12.15/bin:$PATH"
}

Im not sure if this is the place to ask this, so if its not please advise.

Thanks

seanpdoyle commented 7 years ago

During deployments, the gem declares that rake ember:install depends on rake assets:precompile.

The sequence of EmberCLI Rails rake tasks is:

  1. ember:install - invokes npm install (and bower install if you've declared it as a postInstall hook
  2. ember:compile - invokes ember build

If your capistrano deployment involves executing rake assets:precompile, an npm install should be executed.

Do your deployments execute rake assets:precompile?