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 jasmine-node@1.14.5 { [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?

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.

You can try this:

sudo npm install jasmine-node@1.14.2 -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",
  }
}