iJade
iJade

Reputation: 23791

Unable to install karma in Ubuntu

While trying to install karma in ubuntu using command

sudo npm install -g karma

i'm getting errors like

npm ERR!     at Object.parse (native)
npm ERR!     at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:238:23)
npm ERR!     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/index.js:148:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/index.js:876:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/index.js:827:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:910:16
npm ERR!     at process._tickCallback (node.js:415:13)

And a number of errors like

npm ERR! registry error parsing json

And it's not getting installed.Any help would be appreciated.My node.js version is v0.10.13

Upvotes: 1

Views: 4923

Answers (5)

Alessio
Alessio

Reputation: 2068

I had a problem with Ubuntu 12.04 running without sudo, removing the -g option solved the problem installing it locally

npm install karma
npm install

Upvotes: 2

Thiago Mata
Thiago Mata

Reputation: 2959

I have a similar problem installing the karma into the ubuntu inside vagrant. In my case, the install looks good, but don't work as expected.

$ sudo npm install --global karma
$ karma
No command 'karma' found, did you mean:
 Command 'karm' from package 'ktimetracker' (main)
karma: command not found

But, looking in the installation output, I could find where the karma was really installed:

/usr/lib/node_modules/karma/bin/karma

If want to just type karma and run, just run:

 $ sudo ln -s /usr/lib/node_modules/karma/bin/karma /usr/bin/karma & chmod +x /usr/bin/karma

Upvotes: 1

user3139774
user3139774

Reputation: 1335

If anyone needs to install nvm (in order to change node's version), and then Nicolas's instructions:

curl https://raw.github.com/creationix/nvm/master/install.sh | sh
source ~/.profile
nvm ls-remote
nvm install 0.10.15
which node
node --version
sudo npm install karma
node --version
./configure
make 
sudo make install
sudo npm install -g karma

Upvotes: 0

Andrea Perdicchia
Andrea Perdicchia

Reputation: 2786

my npn install karma failed and i resolved my problems with

sudo ln -s /usr/bin/nodejs /usr/bin/node

on ubuntu 13.10

Upvotes: 5

Nico Grunfeld
Nico Grunfeld

Reputation: 1133

I had the same issue, fixed by downloading the source code for 0.10.15 version. ./configure && make && sudo make install then sudo npm install -g karma and it works!

Upvotes: 1

Related Questions