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

后端 未结 8 1702
长情又很酷
长情又很酷 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: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.

提交回复
热议问题