When attempting to initialise a new cdk project in a windows WSL environment, I was confronted with the following error:
cdk init test-app --language python
Usage:
cdk [-vbo] [--toc] [--notransition] [--logo=<logo>] [--theme=<theme>] [--custom-css=<cssfile>] FILE
cdk --install-theme=<theme>
cdk --default-theme=<theme>
cdk --generate=<name>
I first wanted to check the install was still correct but the version number is not displayed:
cdk --version
cdk
All advice online and on Stack Overflow suggests re-installing as root user. I have attempted a global install as root, followed by a restart:
sudo npm install -g aws-cdk
checking for global install version lists the following, showing the update has had global effect:
npm list -g --depth=0 | grep cdk
├── aws-cdk@2.15.0
├── cdk-assume-role-credential-plugin@1.4.0
but the error remains the same. Running the which command confirms it is following the correct user path:
which cdk
/home/user/.local/bin/cdk
This is a new error and I am unable to pinpoint any particular change that could have caused this. I have been able to initialise cdk projects in empty directories before without issue.
cdkwhich is present in/home/user/.local/bin/cdkwhich seems to be hijacking. I'd recommend removing that file if you're sure that's not requiredcdkfile within the local bin folder. I am unsure how this double-install happened or which path it is currently using without it.