Om3ga
Om3ga

Reputation: 32883

first publish npm module does not download dependencies

I just published my npm package. But now when I install it using sudo npm install package-name -g, it does download the package but does not download its dependencies. I know this because when I execute this package command packagename path/to/folder then shows an error about it dependencies that is Error: Cannot find module 'hound'. Hound is its dependency. Below is my package.json file

{
  "name": "package-name",
  "description": "description",
  "version": "0.1.1",
  "homepage": "url",
  "author": {
    "name": "Name",
    "email": "[email protected]"
  },
  "repository": {
    "type": "git",
    "url": "url to git"
  },
  "bugs": {
    "url": "url/issues"
  },
  "licenses": [
    {
      "type": "MIT",
      "url": "url to LICENSE-MIT"
    }
  ],
  "main": "lib/package-name",
  "engines": {
    "node": "0.10.32"
  },
  "devDependencies": {
    "hound": "1.0.4",
    "async": "0.9.0",
    "replace": "0.3.0",
    "grunt": "~0.4.5",
    "node-dir": "0.1.6"
  },
  "keywords": [],
  "preferGlobal": "true",
  "bin": {
    "cssimport" : "lib/package-name.js"
  }
}

How can I change this so when user install my package then its dependency automatically downloads and starts working?

Upvotes: 0

Views: 161

Answers (1)

Robert Moskal
Robert Moskal

Reputation: 22553

Hound is set up as a devDepency, it's not going to be installed in a normal install. If you change that to dependencies it will be. If you need certain things as devDependencies to build your package (like grunt), leave them under that key.

Upvotes: 1

Related Questions