sindresorhus / np

A better `npm publish`
MIT License
7.56k stars 299 forks source link

fix: npm 10 bug with npm pack; issue 740 #743

Closed transitive-bullshit closed 7 months ago

transitive-bullshit commented 7 months ago

Fixes #740

Anyone using np with newer versions of Node.js and npm >= 10 is probably running into this issue. This PR just sanitizes the stdout from npm pack to look for the first [ character to start parsing the output JSON array, which should be backwards compatible with previous functionality.

sindresorhus commented 7 months ago

Can you open an issue or link to an existing npm issue about this as a code comment? I would like to be able to eventually remove that workaround.

transitive-bullshit commented 7 months ago

Looks like this is the corresponding issue to track for npm/cli https://github.com/npm/cli/issues/7354

sindresorhus commented 7 months ago

as a code comment

transitive-bullshit commented 7 months ago

Ahhh missed that. Done 😃

voxpelli commented 7 months ago

Random sidenote: Reminds the that this would be awesome: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1858#issuecomment-1379476814