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

npm ci fails on trying to chmod bin/cdk #12354

Closed
dirkgomez opened this issue Jan 5, 2021 · 13 comments
Closed

npm ci fails on trying to chmod bin/cdk #12354

dirkgomez opened this issue Jan 5, 2021 · 13 comments
Assignees
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. management/devenv Related to CDK development/build environment p1

Comments

@dirkgomez
Copy link
Contributor

I use containers in my CI/CD pipeline that have specific versions of CDK globally preinstalled. When running npm ci I get this error

$ npm ci
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /builds/reporting/sepa_service/node_modules/aws-cdk/bin/cdk
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/builds/reporting/sepa_service/node_modules/aws-cdk/bin/cdk'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
npm ERR! A complete log of this run can be found in:
npm ERR!     /build/.npm/_logs/2021-01-05T13_09_59_080Z-debug.log

Note that the container is pristine, there's no node_modules folder yet.

Here are my devDependencies:

  "devDependencies": {
    "@aws-cdk/assert": "1.79.0",
    "@types/jest": "^26.0.10",
    "@types/node": "10.17.27",
    "aws-cdk": "1.79.0",
    "jest": "^26.6.3",
    "ts-jest": "^26.2.0",
    "ts-node": "^9.0.0",
    "typescript": "~3.9.7"
  },

I've already tried different versions of CDK, more recent versions of the dependent libraries - it doesn't work.

To the best of my knowledge I have started observing this behaviour since upgrading to npm 7.3.0 (from 6.14.5), going back to an older version didn't change the behavious.

Here's now the folder in question looks like when the install fails:

ls -l node_modules/aws-cdk/
drwxr-xr-x 157 build build 5024 Jan  5 13:53 node_modules

Environment

  • CDK CLI Version : 1.18.147
  • Framework Version: 1.79.0
  • Node.js Version: v14.4.0
  • OS : Amazon Linux 2 container
  • Language (Version): TypeScript (3.9.7)

This is 🐛 Bug Report

@dirkgomez dirkgomez added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 5, 2021
@chrismckenna555
Copy link

Seeing this as well with v1.78.0

@revmischa
Copy link
Contributor

Getting this with 1.85.0 (build 5f44668) and npm v7

@jkoelewijn
Copy link

Switching from npm 7.3.0 to npm 6.14.11 solved the problem for me.

@NGL321 NGL321 self-assigned this Feb 1, 2021
@NGL321 NGL321 added investigating This issue is being investigated and/or work is in progress to resolve the issue. management/devenv Related to CDK development/build environment p1 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 1, 2021
@gradybarrett
Copy link

gradybarrett commented Feb 4, 2021

Seeing this as well. Currently using cdk 1.88.0 and npm 7.4.3. Encountering both locally (macOS) and in builds (amazon linux AMIs). Dropping back to 6.14.10 and rebuilding my lock file appears to have fixed the problem.

@mrgrain
Copy link
Contributor

mrgrain commented Feb 11, 2021

Also happens with npm 7.5.3 and seems to be an issues with other packages as well: appium/appium#15095

Maybe it's a certain pattern, that is currently broken in npm 7?

@igilham
Copy link
Contributor

igilham commented Feb 11, 2021

I've seen the same problem with npm 7.5.4 and CDK 1.88.0 and 1.89.0.

CDK 1.87.0 seems to work on My Mac but not on a Linux container in Jenkins.

Mac details:

  • MacOS 10.15.7
  • NodeJS 12.18,0
  • NPM 7.5.4
  • CDK versions tested
    • 1.87.0: OK
    • 1.88.0: Fail
    • 1.89.0: Fail

I'm not sure of the details of my Linux container. Another team manages that.

Looks like the root cause is probably npm/cli#2251

@fulvio-m
Copy link

fulvio-m commented Feb 18, 2021

Also happens on npm 7.5.3/7.5.4 and CDK 1.90.0.
Worked fine in npm 7.5.3 and CDK 1.89.0.

@Blufe
Copy link

Blufe commented Feb 20, 2021

I also happened with NPM (7.5.3 | 7.5.4) and CDK (1.90.0 | 1.90.1).
Earlier CDK versions worked fine.

Update)
After setting NPM 7.5.4 and CDK 1.90.1 and executing the following command, the installation was successful.

rm -rf node_modules package-lock.json 
npm cache clean -f
npm install

davidspeers pushed a commit to davidspeers/trends-server-cdk that referenced this issue Feb 25, 2021
Had to run the following:
rm -rf node_modules package-lock.json
npm cache clean -f
npm install
(from aws/aws-cdk#12354)
@pv93
Copy link

pv93 commented Mar 4, 2021

Seeing the same issue. Deleting package-lock.json is not really an acceptable solution because it defeats the purpose of running npm ci.

@mrgrain
Copy link
Contributor

mrgrain commented Mar 5, 2021

npm 7.5.5+ and 7.6.0+ solved this issue for me.

@dirkgomez
Copy link
Contributor Author

Seeing the same issue. Deleting package-lock.json is not really an acceptable solution because it defeats the purpose of running npm ci.

Exactly, I want to use my package-lock.json.

@dirkgomez
Copy link
Contributor Author

Haven't observed this in quite some time.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. management/devenv Related to CDK development/build environment p1
Projects
None yet
Development

No branches or pull requests