0

I originally installed the cdktf cli on my mac using npm install --global cdktf-cli@latest. I now want to uninstall the cdktf cli, but even after I run `npm uninstall --global @cdktf-cli@latest``` and get the following output:

npm uninstall --global @cdktf-cli@latest

up to date, audited 1 package in 125ms

found 0 vulnerabilities

, and I then run cdktf --help, I still get the following output, showing the tool is still installed:

cdktf --help
cdktf

Commands:
  cdktf init                Create a new cdktf project from a template.
  cdktf get                 Generate CDK Constructs for Terraform providers and
                            modules.
  cdktf convert             Converts a single file of HCL configuration to CDK
                            for Terraform. Takes the file to be converted on
                            stdin.
  cdktf deploy [stacks...]  Deploy the given stacks             [aliases: apply]
  cdktf destroy [stacks..]  Destroy the given stacks
  cdktf diff [stack]        Perform a diff (terraform plan) for the given stack
                                                                 [aliases: plan]
  cdktf list                List stacks in app.
  cdktf login               Retrieves an API token to connect to Terraform Cloud
                            or Terraform Enterprise.
  cdktf synth               Synthesizes Terraform code for the given app in a
                            directory.                     [aliases: synthesize]
  cdktf watch [stacks..]    [experimental] Watch for file changes and
                            automatically trigger a deploy
  cdktf output [stacks..]   Prints the output of stacks       [aliases: outputs]
  cdktf debug               Get debug information about the current project and
                            environment
  cdktf provider            A set of subcommands that facilitates provider
                            management
  cdktf completion          generate completion script

Options:
      --version                   Show version number                  [boolean]
      --disable-plugin-cache-env  Dont set TF_PLUGIN_CACHE_DIR automatically.
                                  This is useful when the plugin cache is
                                  configured differently. Supported using the
                                  env CDKTF_DISABLE_PLUGIN_CACHE_ENV.
                                                      [boolean] [default: false]
      --log-level                 Which log level should be written. Only
                                  supported via setting the env CDKTF_LOG_LEVEL
                                                                        [string]
  -h, --help                      Show help                            [boolean]

Options can be specified via environment variables with the "CDKTF_" prefix
(e.g. "CDKTF_OUTPUT")

Does anyone know how I can remove the cdktf cli for good, such that when I try to run cdktf --help I'll get something like "no tool found".

3
  • It's wired if you can't unintsall a npm global package installed by npm. But try use which to see where the location of this command is. In your terminal, input which cdktf, and check the result. Commented Oct 23, 2022 at 15:53
  • 1
    And try this command npm uninstall --global cdktf-cli, it looks like there is an extra @ in your command Commented Oct 23, 2022 at 15:54
  • Thanks - running npm uninstall --global cdktf-cli worked
    – Sabo Boz
    Commented Oct 23, 2022 at 15:58

1 Answer 1

0
npm uninstall -g cdktf-cli

I faced the same issue, but somehow, this command will uninstall global cdktf-cli from your machine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.