Skip to content

Add metadata to mark peer dependencies as optional for npm7+#62

Open
keeganstreet wants to merge 1 commit intoAlorel:masterfrom
keeganstreet:patch-1
Open

Add metadata to mark peer dependencies as optional for npm7+#62
keeganstreet wants to merge 1 commit intoAlorel:masterfrom
keeganstreet:patch-1

Conversation

@keeganstreet
Copy link
Copy Markdown

In npm 7 and npm 8, peer dependencies are installed by default.

iltorb and node-zopfli-es are only required for older versions of Node, and it doesn't make sense for them to be installed automatically when shrink-ray-current is installed.

This change adds a peerDependenciesMeta field to mark these peer dependencies as optional https://docs.npmjs.com/cli/v8/configuring-npm/package-json#peerdependenciesmeta

@keeganstreet
Copy link
Copy Markdown
Author

Hi @Alorel , any chance you could release this patch?

The iltorb installation errors out in environments without python available. We don't need iltorb to be installed automatically (which is the default behaviour for peer dependencies in recent npm versions).

@ShrijalFetchly
Copy link
Copy Markdown

@keeganstreet @Alorel will this be merged?

@keeganstreet
Copy link
Copy Markdown
Author

The maintainer is taking a bit of a break. The deprecated iltorb and node-zopfli-es packages can be blocked in consuming apps by adding the following config to the package.json file of the consuming app:

  "overrides": {
    "iltorb": "npm:node-noop",
    "node-zopfli-es": "npm:node-noop"
  }

This will install https://www.npmjs.com/package/node-noop (a placeholder package that doesn't do anything) instead of iltorb and node-zopfli-es.

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

Successfully merging this pull request may close these issues.

2 participants