NPM不发布依赖关系

我一直在使用Node和npm Packages作为CLI应用程序。 我有一个package.json项目,所有填写正确。 当我通过WebStorm运行带有不同参数的应用程序时,它一切正常。 如果我发布npm包,但是......没有依赖关系...... npm站点找不到一个......并且当我安装CLI应用程序时,它运行失败,因为是......依赖关系没有被拉入...

这是我的package.json

 {
  "name": "wmg",
  "version": "0.0.8",
  "description": "A Commandline Foolin around",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/Arvraepe/wmg.git"
  },
  "keywords": ["Stuff", "Foolin"],
  "target": "main",
  "preferGlobal": true,
  "bin": {
    "wmg": "wmg.js"
  },
  "author": "Arne Van Raepenbusch <arvraepe@gmail.com>",
  "license": "ISC",
  "devDependencies": {
    "prompt": "^0.2.14",
    "restify": "^3.0.3",
    "underscore": "^1.8.3"
  }
}

我试过运行pakmanager deps,但是这给了我这个奇怪的错误

======================= WARNING =======================
Assuming browser mode by default is deprecated.
  Include browserDependencies in your package.json
  -- OR --
  pakmanager -e browser build

In the next release of pakmanager, the node environment will be assumed as default
=======================================================


Targeted Environment: browser
[[[deps]]]
[ERROR] The following packages are `require`d, but not in the package, nor on npm:
  wmg
pakmanager {}


======================= WARNING =======================
Assuming browser mode by default is deprecated.
  Include browserDependencies in your package.json
  -- OR --
  pakmanager -e browser build

In the next release of pakmanager, the node environment will be assumed as default
=======================================================

当然,我的包装不应该依赖自己?

有人可以更多地了解这一点吗?


我查看了你的包,正如其他人已经注意到你有devDependencies列出但没有dependenciesdevDependencies通常用于测试框架之类的东西,您需要在该软件包上工作但不使用它。 promptrestify都在您的应用程序中使用,应该列在dependencies对象中而不是devDependencies


你的package.json文件不包含依赖关系。 只有npm假定的devDependencies仅用于开发(例如mocha),并且安装时不需要。

如果您的任何devDependencies是实际的用户依赖项,则将它们移至依赖项。

链接地址: http://www.djcxy.com/p/27665.html

上一篇: NPM does not publish dependencies

下一篇: UNMET PEER DEPENDENCY D3.js and Angular 2