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:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The other workaround is to use another package manager setting.
Fortunately, pruning via package manager will be removed in a future major version.
I noticed that
electron-packager
runsnpm prune --production
when compiling. looks like this issue relates to another one here: https://github.com/npm/npm/issues/19356a 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