I just introduced npm modules into my Rails app (locally) and have been trying to deploy it to Heroku. I recall reading that if I have a package.json file at the root directory of my app, Heroku would detect it and run npm install upon build. My assets, however, are apparently not being installed (for example, webpack). How can I make this work?
Asked
Active
Viewed 554 times
2
-
You should be able to `heroku run npm` – Joel Oct 21 '16 at 15:29
-
I've done that and the response was `Running npm install on ⬢ soultrust-films... up, run.5830 (Free) bash: npm: command not found` – soultrust Oct 21 '16 at 15:32
-
This looks like it can be helpful https://coderwall.com/p/6bmygq/heroku-rails-bower – Joel Oct 21 '16 at 15:35
1 Answers
3
The solution is to use multiple buildpacks.
Using Multiple Buildpacks for an App
For example, to set a buildpack:
heroku buildpacks:set heroku/ruby
And to add a buildpack:
heroku buildpacks:add --index 1 heroku/nodejs

soultrust
- 581
- 1
- 7
- 17