karma command not found when karma already installed

前端 未结 9 1838
独厮守ぢ
独厮守ぢ 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:32

    I was also facing the same issue. It looks like karma for command line is a separate package which can be installed by

    npm install -g karma-cli

    0 讨论(0)
  • 2021-01-30 20:33

    @mayankcpdixit gave the answer up there in a response to the OP's original question, but I'll put it here again in case anyone misses it.

    You do not need to uninstall everything, and if I had to manually add a new path link for every npm package I try to install I'd probably shoot myself.

    npm install -g karma-cli
    

    Boom. Now you have karma command lines installed. Just like Grunt.


    Edit: Please don't forget to upvote @mayankcpdixit as well, he commented directly on the original post, but didn't actually "answer" the question.

    0 讨论(0)
  • 2021-01-30 20:33

    Try re-installing node.js. There are lots of ways to install it, but I recommend downloading from nodejs.org

    If that doesn't work, you may try to re-install karma.

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