Running karma after installation results in 'karma' is not recognized as an internal or external command

后端 未结 8 1679
长情又很酷
长情又很酷 2020-12-07 19:48

I\'m trying to run karma as part as an angular-seed project, after installing karma using

npm install -g karma

I get:



        
相关标签:
8条回答
  • 2020-12-07 20:23

    Official documentation at https://karma-runner.github.io/0.12/intro/installation.html is confusing. It implies that npm install -g karma-cli is to install karma globally but it actually required for to run karma from command line.

    0 讨论(0)
  • 2020-12-07 20:27

    I had the same issue and fixed it by correcting my PATH environment variable.

    STEP 1: go to the following path and ensure karma.cmd is present at the location given below

    [Nodejs folder path]\node_modules\.bin <=> C:\Program Files\nodejs\node_modules\.bin

    STEP 2: If present go to STEP 3, If not present run the following command npm install -g karma

    STEP 3: Open environment variables and edit PATH

    STEP 4: Add the following at the end :

    [Nodejs folder path]\node_modules\.bin; <=> "C:\Program Files\nodejs\node_modules\.bin"

    Log out your session and it will work for sure.

    0 讨论(0)
提交回复
热议问题