Skip to content

fix: drop --scripts-prepend-node-path from npm start - #3028

Open
kalayciburak wants to merge 2 commits into
diffplug:mainfrom
kalayciburak:fix/npm-serve-without-scripts-prepend-node-path
Open

fix: drop --scripts-prepend-node-path from npm start#3028
kalayciburak wants to merge 2 commits into
diffplug:mainfrom
kalayciburak:fix/npm-serve-without-scripts-prepend-node-path

Conversation

@kalayciburak

Copy link
Copy Markdown
Contributor

Fixes

Fixes #3024

Changes and Review

npm start was launched with --scripts-prepend-node-path=true. npm 11 warns that this is an unknown CLI config; npm 12 fails with EUNKNOWNCONFIG and the prettier (and other npm-based) formatter server never starts.

Node is already prepended onto PATH in environmentVariables(), which is what that flag used to do. Drop the flag and keep npm start -- --node-server-instance-id=....

Test Plan

  • ./gradlew :lib:test --tests com.diffplug.spotless.npm.StandardNpmProcessFactoryTest — RED then GREEN
  • ./gradlew :lib:test --tests 'com.diffplug.spotless.npm.*' — 15/15 GREEN
  • ./gradlew :lib:spotlessJavaCheck — GREEN

Please DO NOT FORCE PUSH. Don't worry about messy history.

npm 12 treats unknown CLI flags as errors. Node is already on PATH
via the process environment, so the flag is unnecessary.

Fixes diffplug#3024
@nedtwigg

Copy link
Copy Markdown
Member

lgtm, needs 3 changelog entries under the ### Fixed header

Add Unreleased Fixed bullets in lib, gradle, and maven changelogs.
@kalayciburak

Copy link
Copy Markdown
Contributor Author

added the 3 changelog entries under Fixed

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.

prettier incompatibility with npm 12

2 participants