karma command not found when karma already installed

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

    In your ~/.bash_profile (or similar) amend your PATH to include npm-installed binaries:

    export PATH="$PATH:/usr/local/share/npm/bin"
    

    I had this very same issue, and found this solution to be less time-consuming and impactful than completely re-installing node.

    EDIT this has also worked for others in bash_profile

    export PATH="$PATH:/usr/local/lib/node_modules/karma/bin" 
    

提交回复
热议问题