Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

CDK npm-shrinkwrap.json has become corrupted; claims to be version 2 but is missing bin information #294

Closed
adamnovak opened this issue Feb 1, 2022 · 1 comment

Comments

@adamnovak
Copy link
Contributor

The npm-shrinkwrap.json file for the CDK code was upgraded to lockfile format version 2, but this upgrade process was botched and "bin" entries were not created for the packages that need them.

As noted in npm/cli#4308 this can happen when using npm@8 on a file generated with npm@6, without going through npm@7's migration code.

The resulting npm-shrinkwrap.json file results in npm install run with NPM 6, 7, or 8 not creating the symlinks in node_modules/.bin that allow tools like prettier to be executed. The information on what to link there isn't sourced from the packages themselves like with the v1 format, but it's also missing from where it should be stored in the v2 format.

This causes the AGC build to fail thusly:

make[2]: Entering directory `/public/groups/cgl/graph-genomes/anovak/build/amazon-genomics-cli/packages/wes_adapter'
./format-code.sh

> cdk@0.1.0 pretest
> eslint --ignore-path .gitignore '{**/*,*}.{ts,tsx}'


> cdk@0.1.0 format
> prettier --write '{**/*,*}.{ts,tsx}'

sh: prettier: command not found
sh: eslint: command not found
make[2]: *** [format] Error 127

Reverting to the v1-format npm-shrinkwrap.json in be5c684 allows the bin symlinks to be created.

Beyond using .nvmrc, it may be useful to force a particular NPM version for all developers to prevent problems like this from happening.

@adamnovak
Copy link
Contributor Author

Sorry, this is just a dupe of #292.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant