fix for npm >= 5.3.0, changed tempDir location to os.tmpDir() #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
error when running npm-bundle with npm >= 5.3.0:
underlying reason of the problem: https://stackoverflow.com/questions/45555682/npm-install-local-package-creates-symbolik-link
turns out, that instead of copying the whole project contents when doing
npm i <folder>
, npm creates symbolic link, after thatrimraf
was being called to remove.npmbundle
from nestednode_modules
; unfortunately, since it was a symlink, it also removed original tempdir contents and couldn't find originalpackage.json
and hence the errorwhat I did to fix it was just changing location of tempDir to os.tmpDir() instead of putting it within the project directory, that does the trick (at least works for me on Windows)
unfortunately, the fix is not 100% good, because it still operates on a symlink and due to that, after running npm-bundle, I end up with modified
package.json
in my project, withbundledDependencies
appended