sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
867 stars 44 forks source link

Dependency deprecation warning in Node 16+ #124

Open Michionlion opened 3 years ago

Michionlion commented 3 years ago

In Node 16 and up, running prettier-standard generates the following error:

(node:416235) [DEP0128] DeprecationWarning: Invalid 'main' field in '/home/saejin/projects/personal/indexify/node_modules/find-parent-dir/package.json' of 'find-parent-dir.js'. Please either fix that or report it to the module author

This is caused by a dependency of prettierx -- find-parent-dir. A fix was released as version 0.3.1 of that package, and incorporated in prettierx in version 0.18.2. The version of prettierx used in prettier-standard should probably be updated to 0.18.2 or 0.19.0 (the latest as of this issue); some preliminary testing by forcing resolution seems to not cause any issues.

In the meantime, people who encounter this issue can add the following snippet to their package.json, and Yarn will force prettierx version 0.19.0 (with patches) to be installed instead of the current 0.11.3. Npm has an old plugin to do the same, and a new RFC for the same functionality under a different name.

"resolutions": {
  "prettierx": "~0.19.0"
}