-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running 'npm pack' after using shrinkpack produces an unusable tarball #69
Comments
I may be misunderstanding the use case, but it sounds like you are using shrinkpack inside a library that will be distributed for others to install using npm. Is that the case? If so, then see #56 (comment) for an explanation of how this is not the intended use case for shrinkpack.
Please correct me if I misunderstood what it is you're trying to do. |
I guess the use case I am encountering is the borderline of your comment above. The use case is installing a node application on a (production) server with no external network access - i.e. no internet access and no git repo access. Whilst it may not be the initial intended purpose of this project, this project fits the bill for that purpose pretty well. The negatives you have mentioned do not apply to this use case as these distributables are used solely as self-contained applications, not provided to any registry to be further developed on/reused by. |
That's an interesting use case! And as you say, it's quite different from the "wrapping dependencies of a distributed library" situation. I've never tried the packed application approach, so I'm probably unable to suggest anything useful. Just out of curiosity though: are you using |
I was going down the route of bundledDependencies before I came across shrinkpack - my (very limited and quite possibly incorrect) understanding of bundledDependencies is that you may hit issues when working cross-platform - i.e. package on windows and deploy on linux as it's the node_modules folder that gets passed about and therefore that may contain platform-specific variations of dependencies. For the record my current workaround for this issue is to manually archive the application using zip or tar rather than using This workaround however just feels a little inelegant given the existence of |
Sorry for the delay, I have updated the README to try and better explain how shrinkpack works currently and the kinds of situations it can be used. Please let me know if this does not help and more should be done, thanks. |
Steps to Reproduce
Follow the shrinkpack-demo from the main page.
After the last step where the "co-worker" has run npm install, follow these steps in the "co-worker's" directory.
npm pack
This will produce a file called
shrinkpack-demo-1.0.0.tgz
.Move this
shrinkpack-demo-1.0.0.tgz
to a clean directory and then run:npm install shrinkpack-demo-1.0.0.tgz
You will see the following error:
The problem appears to be that it is expecting to find the
node_shrinkwrap
folder in the current directory as in the directory npm is run from. When install a tarball created using npm however the directory that it is installed to will be more likenode_modules/shrinkpack-demo/node_shrinkwrap
Expecting:
./node_shrinkwrap/
Actual:
./node_modules/shrinkpack-demo/node_shrinkwrap
Node Version: 4.4.0
NPM Version: 2.14.20
npm-debug.log attached.
npm-debug-log.txt
The text was updated successfully, but these errors were encountered: