【发布时间】:2015-09-21 19:12:03
【问题描述】:
我一直在玩弄 Node 和 npm 包作为 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
=======================================================
我的包肯定不应该依赖于它自己吗?
有人能解释一下吗?
【问题讨论】:
标签: json node.js npm command-line-interface