karma command not found when karma already installed

前端 未结 9 1871
独厮守ぢ
独厮守ぢ 2021-01-30 19:49

I used node.js to install karma. My first try failed when running the following command on Terminal:

npm install -g karma

That failed so I dec

9条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 20:22

    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:

    karma start
    

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

    cd /usr/local/lib/node_modules/karma
    

    Good luck!

提交回复
热议问题