0

When I remove the devDependencies array, trimArguments installs fine. If I give it a dev-dependency, it seems to completely ignore trimArguments. No warning, just silent failure. My package.json is the following:

{"name":"asyncFuture",
 "version":"0.1.0",
 "main": "asyncFuture.js",
 "dependencies":[
    "git+https://git@github.com/fresheneesz/trimArguments.git#578afe0fa6ce96797c36e018bf5bae31b508a02f"
 ],
 "devDependencies": [
    "git+https://git@github.com/fresheneesz/deadunit.git#8395e438492267b94ef51ee4f94a6d6c8f1c15da"
 ],
 "repository": {
   "type": "git",
   "url": "git://github.com/fresheneesz/asyncFuture"
 }
}

Is this an NPM bug or am I misunderstanding how to use this? NPM version 1.3.8 on windows 7 32-bit

UPDATE

It's looking like npm is ignoring any package except for the last one, even if I put all dependencies under the "dependencies" array (and get rid of devDependencies). This has to be a bug. I'm gonna file a ticket.

4

2 回答 2

4

使用URL 作为依赖项时:

您可以指定一个 [...] URL 来代替版本范围

值得注意的dependencies是:

使用包名称版本范围的简单散列指定。

即使使用 (Git) URL,您仍然需要指定包名称。

  "dependencies": {
    "trimArguments": "git+https://git@github.com/fresheneesz/trimArguments.git#578afe0fa6ce96797c36e018bf5bae31b508a02f"
  },
  "devDependencies": {
    "deadunit": "git+https://git@github.com/fresheneesz/deadunit.git#8395e438492267b94ef51ee4f94a6d6c8f1c15da"
  }
于 2013-08-26T08:26:10.687 回答
2

dependencies并且devDependencies不是数组;它们是地图。

https://npmjs.org/doc/json.html#dependencies

于 2013-08-26T07:27:18.060 回答