question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dependency from github not included in build due to NPM pruning

See original GitHub issue
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue: I need to include a dependency directly from github targeting a specific branch:

"dependencies": { "hoxy": "github:trickpattyFH20/hoxy#forkrelease" }

This does not get included in the compiled build using electron-packager After running the compiled build, I will see this error:

“Uncaught Exception: Error: Cannot find module ‘hoxy’”

If I inspect the .app directory, hoxy is indeed missing

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
maleptcommented, Jan 30, 2018

The other workaround is to use another package manager setting.

Fortunately, pruning via package manager will be removed in a future major version.

1reaction
trickpattyFH20commented, Jan 30, 2018

I noticed that electron-packager runs npm prune --production when compiling. looks like this issue relates to another one here: https://github.com/npm/npm/issues/19356

a temp workaround can be to install github dependencies using the tarball url rather than the .git url

so instead of: npm i --save github:trickpattyFH20/hoxy#forkrelease use: npm i --save https://github.com/trickpattyFH20/hoxy/tarball/forkrelease

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm prune is removing packages installed using git #19356
I'm opening this issue because: npm is crashing. npm is producing an ... dependency from github not included in build due to NPM...
Read more >
[BUG] npm prune --production rebuilds packages installed ...
In my case it fails to build native module and as the result after pruning (which doesn't fails for some reason) I have...
Read more >
npm prune removes dependencies it shouldn't #15069 - GitHub
I'm opening this issue because: npm is producing an incorrect install. npm is doing something I don't understand.
Read more >
[BUG] git dependency installed with npm ci triggers error with ...
When installing some git dependencies using the Docker image node:10-alpine via npm ci, attempts to npm prune --production result in an ...
Read more >
Missing dependencies after running `npm install` a second time
I'm opening this issue because: npm is crashing. npm is producing an incorrect install. npm is doing something I don't understand.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found