Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix npm run release (np) error #7570

Merged
merged 2 commits into from
Mar 24, 2024
Merged

Fix npm run release (np) error #7570

merged 2 commits into from
Mar 24, 2024

Commits on Mar 23, 2024

  1. Fix npm run release (np) error

    ```
    $ npm run release
    
    > stylelint@16.2.1 release
    > np --no-release-draft
    
    ✖ Error: Failed to parse output of npm pack
        at Module.getFilesToBePacked (file:///Users/masafumi.koba/git/stylelint/stylelint/node_modules/np/source/npm/util.js:147:9)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async Module.getNewFiles (file:///Users/masafumi.koba/git/stylelint/stylelint/node_modules/np/source/util.js:107:27)
        at async checkNewFilesAndDependencies (file:///Users/masafumi.koba/git/stylelint/stylelint/node_modules/np/source/ui.js:82:19)
        at async ui (file:///Users/masafumi.koba/git/stylelint/stylelint/node_modules/np/source/ui.js:138:30)
        at async getOptions (file:///Users/masafumi.koba/git/stylelint/stylelint/node_modules/np/source/cli-implementation.js:146:18)
        at async file:///Users/masafumi.koba/git/stylelint/stylelint/node_modules/np/source/cli-implementation.js:163:45
    ```
    
    This error's cause is that `npm pack` outputs an invalid JSON due to `patch-package` output.
    
    Instead of the `prepare` hook, the `postinstall` hook is not executed with `npm pack`.
    
    See also:
    - https://github.com/ds300/patch-package#set-up
    - https://docs.npmjs.com/cli/v10/using-npm/scripts
    ybiquitous committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    1afff0f View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2024

  1. Configuration menu
    Copy the full SHA
    3fb479b View commit details
    Browse the repository at this point in the history