gpt4 book ai didi

json - NPM 不发布依赖

转载 作者:搜寻专家 更新时间:2023-10-31 23:47:47 24 4
gpt4 key购买 nike

我一直在把 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 但没有 dependencies。通常 devDependencies 用于测试框架之类的东西,你需要在包上工作但不使用它。 promptrestify 都在您的应用中使用,应该列在 dependencies 对象中,而不是 devDependencies

关于json - NPM 不发布依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31215356/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com