marcc
marcc

Reputation: 12409

package.json isn't installing dependencies when running npm install

I've created a package.json file for my private app. In it, I have my dependencies listed, as expected. Some of those dependencies have dependencies of their own. When running npm install on my app, it's not installing the dependencies of my dependencies. Is there something wrong with my package.json file which is preventing this? ("winston" is one of my dependencies which isn't properly installing)

{  
  "name": "my app",  
  "version": "0.0.1",  
  "dependencies" : {  
    "connect" : "1.8.5",  
    "express" : "2.5.8",  
    "socket.io" : "0.8.7",  
    "winston" : "0.5.9"
  },  
  "engine": {  
    "node": ">=0.6"  
  }  
}

Reponse to comments: NPM installs the top level deps, fine, no errors, it looks like it works. It just never downloads the deps of the deps. Will try the -d option.

Upvotes: 18

Views: 31439

Answers (3)

Samuel
Samuel

Reputation: 1389

Spaces are not allowed in the name option for package.json files.

The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't contain any non-URL-safe characters.

https://docs.npmjs.com/files/package.json#name

Upvotes: 4

magikid
magikid

Reputation: 308

I had the same issue and with some googling, it seems that this is a problem in node.js: https://github.com/isaacs/npm/issues/1341

Upvotes: 1

ming_codes
ming_codes

Reputation: 2922

I noticed the winston line is ended with ,

This is not a valid JSON.

Upvotes: 0

Related Questions