Skip to content
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

All I want is paper-core.js and I want to install it via NPM without installing all those dependencies without warning. #1308

Closed
tom10271 opened this issue Apr 11, 2017 · 5 comments

Comments

@tom10271
Copy link

tom10271 commented Apr 11, 2017

Is it possible? I don't want to use bower. My manager is not happy with installing so much dependencies that we are not going to use at all.

If it is impossible then we can't go with paper.js

Thanks

@tom10271
Copy link
Author

Ok everyone if you are in the same situation that you want to install paper.js only via npm, then you need to mark it as no-optional

{
  "dependencies": {
    "paper": {
      "version": "^0.10.3",
      "no-optional": "true"
    },

@tom10271
Copy link
Author

Maybe this should be documented near Installing Paper.js with bower or something like that

@simonemazzoni
Copy link

@tom10271 does it works for you? I just tried, but it doesn't work. It simply ignores the paper package. 🤕

@tom10271
Copy link
Author

I am sorry I checked it again it is actually not working... The only way to install Paper.js with optional dependencies is run npm install --no-optional which the flag can't be stored in package.json

@tom10271
Copy link
Author

tom10271 commented Apr 12, 2017

@simonemazzoni I have a new solution.

First, install it with the command:
npm install paper --no-optional

Then run npm shrinkwrap to lock dependencies versions.

Once locked other developers can simply run npm install to install all packages required.
Installing/uninstalling packages will also update npm-shrinkwrap.json automactically.

However, I do experience npm warning when I tried to install a package which npm unexpectedly attempt to install node-canvas but it shouldn't be a problem. If you seriously care about the warning then always run npm install with flag --no-optional

Reference:
http://stackoverflow.com/questions/33542712/npm-never-install-nested-optional-dependencies-for-npm-package

https://docs.npmjs.com/cli/shrinkwrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants