Search code examples
node.jsinstallationnpmkarma-runnerinstallation-package

npm install -g karma does not install executable


I have what looks like successful karma installation, yet karma is not in /usr/local/bin/ and is not found by bash.

Any idea what is wrong and how to fix it?

Here are the end installation messages:

> [email protected] install /usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished
[email protected] /usr/local/lib/node_modules/karma
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])


Solution

  • You can link it by yourself. As in:

    #Assuming that /usr/local/bin is in your PATH
    cd /usr/local/bin
    ln -s /usr/local/lib/node_modules/karma/bin/karma
    

    Clearly, this is not an ideal solution. I think there's a problem in the package.json of karma which prevents npm to create a link to the executable. Might be related to this.