(cli): Can't build the code after upgrading to 1.79.0
See original GitHub issueAfter upgrading to version 1.79.0 (from 1.78.0), I get the following error:
❯ npm run build
> infra-cluster@0.1.0 build
> tsc
node_modules/@aws-cdk/aws-cloudfront/lib/index.d.ts:8:10 - error TS1005: 'from' expected.
8 export * as experimental from './experimental';
~~
node_modules/@aws-cdk/aws-cloudfront/lib/index.d.ts:8:13 - error TS1005: ';' expected.
8 export * as experimental from './experimental';
~~~~~~~~~~~~
node_modules/@aws-cdk/aws-cloudfront/lib/index.d.ts:8:26 - error TS1005: ';' expected.
8 export * as experimental from './experimental';
~~~~
node_modules/@aws-cdk/aws-cloudfront/lib/index.d.ts:8:31 - error TS1005: ';' expected.
8 export * as experimental from './experimental';
~~~~~~~~~~~~~~~~
Found 4 errors.
Unfortunately downgrading package.json
to 1.78.0 doesn’t solve the issue.
Reproduction Steps
I’m not sure how to reproduce it (other than my own code) because we also have a couple of other stacks which are working just fine, though they are way (just two ECR repositories and a bunch of IAM stuff) smaller than the cluster stack.
I also noticed something else recentaly which is a bit weird: every time I need to install (npm install
) some package in my application, I had to remove the whole node_modules
folder and package-lock.json
file, otherwise it fails with:
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/aws-cdk/bin/cdk
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/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! /Users/rad/.npm/_logs/2020-12-17T14_56_28_547Z-debug.log
Not sure if it’s related at all.
What did you expect to happen?
To upgrade to the new version
What actually happened?
It fails to compile the code with the above error message.
Environment
- CDK CLI Version : 1.78.0 (-> 1.79.0)
- Framework Version: 1.78.0 (-> 1.79.0)
- Node.js Version: v15.3.0
- OS : macOS 11.1-20C69
- Language (Version): 3.7.5
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Just figured it out, it is necessary to upgrade typescript.
Upgrading typescript from ~3.7.5 to ~3.9.7 (as set in package.json) fixed it for me.
This worked for me as well. Be sure to remove package-lock.json and node_modules then: npm install --save-dev typescript@3.9.7