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

Created on 11 Apr 2017  路  5Comments  路  Source: paperjs/paper.js

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

All 5 comments

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"
    },

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

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

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

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

khurramraheel picture khurramraheel  路  7Comments

wes-r picture wes-r  路  3Comments

arel picture arel  路  3Comments

przyb picture przyb  路  5Comments

sansumbrella picture sansumbrella  路  3Comments