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

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

    karma-cli

    It is recommended to install karma with its Command-Line-Interface (karma-cli) which will take care of fetching the appropriate karma. You can also install a different local version specific to each project you're working on and karma-cli will pick the appropriate one.

    From the karma installation page:

    Typing ./node_modules/karma/bin/karma start sucks so you might find it useful to install karma-cli globally:

    npm install -g karma-cli
    

    Now, check that karma was installed by typing:

    which karma  //echo something like: /usr/local/bin/karma
    

    and check that karma server is working (ctr+c to quit):

    karma start 
    

    You can also check that karma was installed by going to this directory:

    cd /usr/local/lib/node_modules/karma
    

    Good luck!

提交回复
热议问题