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

[BUG] v7 erroneously reports removal of packages #3574

Open
1 task done
yo1dog opened this issue Jul 24, 2021 · 0 comments
Open
1 task done

[BUG] v7 erroneously reports removal of packages #3574

yo1dog opened this issue Jul 24, 2021 · 0 comments
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@yo1dog
Copy link

yo1dog commented Jul 24, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

After installing aws-cdk package, subsequent npm commands such as install, prune, etc. always report "removed 7 packages" and the following lines:

npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/yallist
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/semver
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/lru-cache
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/yallist
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/lru-cache
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema

All of the above directories still exist after each command, so they are not actually deleted.

This bug appears to have been introduced in v7.0.0 as it occurs in v7.20.1, v7.0.0, but not in v6.14.13.

Expected Behavior

No packages were removed and npm should report as such.

Steps To Reproduce

mkdir v6
cd v6
npx npm@6 --version         # 6.14.13
npx npm@6 i aws-cdk@1.115.0 # added 181 packages from 216 contributors and audited 181 packages in 2.724s
stat node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/yallist # does not exist
npx npm@6 i --ddd           # audited 181 packages in 1.039s
stat node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/yallist # does not exist
npx npm@6 i --ddd           # audited 181 packages in 0.944s
npx npm@6 prune -ddd        # audited 181 packages in 0.897s
npx npm@6 prune -ddd        # audited 181 packages in 1.008s

cd ..
mkdir v7
cd v7
npx npm@7 i --version       # 7.20.1
npx npm@7 i aws-cdk@1.115.0 # added 181 packages, and audited 182 packages in 2s
stat node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/yallist # exists
npx npm@7 i --ddd           # removed 7 packages, and audited 182 packages in 734ms
stat node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/yallist # exists
npx npm@7 i --ddd           # removed 7 packages, and audited 182 packages in 728ms
npx npm@7 prune --ddd       # removed 7 packages, and audited 182 packages in 699ms
npx npm@7 prune --ddd       # removed 7 packages, and audited 182 packages in 1s

Notice the output for all but the first npm commands report "removed 7 packages" for v7 but not for v6. Also, the following lines:

npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/yallist
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/semver
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/lru-cache
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/yallist
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/lru-cache
npm sill REMOVE node_modules/aws-cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema

Notice these reported directories were never created in v6, and in v7 they are never deleted (still exist every v7 npm command) despite being reported as "REMOVE".

Attached the output for the first 3 install commands and the package files for v7:
1.log
2.log
3.log
package.json.txt
package-lock.json.txt

Environment

  • OS: Ubuntu 18.04.3 LTS (WSL2)
  • Node: v14.17.0
  • npm: 7.20.1
@yo1dog yo1dog added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jul 24, 2021
@nlf nlf added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants