Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku cannot find local npm package

I have a local npm package included in my repo (I don't include the whole node_modules into my repo due to its over 200mb size, only specific package that I had to modify to suit my needs).

In package.json, local package declaration looks like this:

dependencies : { 
  local_package: "./my_local_package"
  ...
}

the error I got

 npm ERR! enoent ENOENT: no such file or directory, open 
 '/app/tmp/cache/my_local_package'

I'm not sure if /app/tmp/cache is the place where my repo resides and if it's not to what should I change it.

node v4.2.1, npm v2.14.7

like image 381
evfwcqcg Avatar asked Oct 20 '15 05:10

evfwcqcg


People also ask

How do I run npm on Heroku?

Run the npm install command in your local app directory to install the dependencies that you declared in your package. json file. Start your app locally using the heroku local command, which is installed as part of the Heroku CLI. Your app should now be running on http://localhost:5000/.

Does Heroku automatically npm install?

By default, Heroku will install all dependencies listed in package.

Does Heroku run npm build?

By default, Heroku runs npm start while starting deployed Node.


1 Answers

According to npm documentation for local paths, you should define it this way:

"dependencies" : { 
  "local_package": "file:./my_local_package"
  ...
}
like image 90
SarathMS Avatar answered Nov 12 '22 21:11

SarathMS