Make node-sass optional in peerDependencies#55
Conversation
StetsenkoBohdan2002
commented
Sep 5, 2024
- Added peerDependenciesMeta section in package.json to mark node-sass as optional.
- This change allows users to install either node-sass or sass without warnings if node-sass is not present.
- Ensures greater flexibility for users who prefer using Dart Sass or other implementations.
cduivis
left a comment
There was a problem hiding this comment.
I saw 2 small improvements:
- increase the patch version of the package.
- increase the Node version to one that supports NPM with
peerDependenciesMeta.
See the pull request remarks for more details.
| "node-sass": ">=3.8.0", | ||
| "sass": ">=1" | ||
| }, | ||
| "peerDependenciesMeta": { |
There was a problem hiding this comment.
Hey I'm not the maintainer of this package, but I was also looking at creating a PR when I found yours.
TLDR: My suggestion is to also update the engine node version to at least 10.
Reasoning:
peerDependenciesMeta is a feature introduced in NPM 7, which was released with Node version 15.
If I take a look at the release notes from that time. NPM 7 only works with Node versions 10 and up:

https://docs.npmjs.com/cli/v7/using-npm/changelog#some-high-level-changes-and-improvements
So on line 29 I would also upgrade node "node": ">=4" towards at least "node": ">=10".
There was a problem hiding this comment.
The patch version of the package should also be increased by 1:
line 3 : 3.0.0 -> 3.0.1
As 3.0.0 already exists as a NPM package:
https://www.npmjs.com/package/sass-extract?activeTab=versions