Guilherme Oderdenge
Guilherme Oderdenge

Reputation: 5011

package.json vs. "npm install %s -g"

A package.json example:

{
  "devDependencies": {
    "jasmine-node": ""
  }
}

It just won't work. Some errors like the following will appear:

npm ERR! error rolling back Error: UNKNOWN, unlink '/vagrant/x/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js' npm ERR! error rolling back [email protected] { [Error: UNKNOWN, unlink '/vagrant/x/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js'] npm ERR! error rolling back errno: -1, npm ERR! error rolling back code: 'UNKNOWN', npm ERR! error rolling back path: '/vagrant/x/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js' } npm ERR! Error: UNKNOWN, symlink '../coffee-script/bin/coffee' npm ERR! If you need help, you may report this entire log, npm ERR! including the npm and node versions, at: npm ERR! http://github.com/npm/npm/issues

But if I do npm install jasmine-node -g, everything install and works seamlessly and I can't see why.

Can someone clarify this question for me?

Upvotes: 1

Views: 494

Answers (2)

Manwal
Manwal

Reputation: 23836

You can try this:

sudo npm install [email protected] -g

Current version is 1.14.3, so it is one version behind.

In package.json try:

{
  "devDependencies": {
    "jasmine-node": ">=1.14.3"
    "jasmine-reporters": "~1.0.0",
  }
}

Upvotes: 2

eguneys
eguneys

Reputation: 6406

Remove that line from package.json and do npm install --save-dev jasmine-node that will install it and add the correct line in your devDependencies.

Upvotes: 1

Related Questions