node.js npm WARN package.json [email protected] 没有存储库字段
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34020746/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
npm WARN package.json [email protected] No repository field
提问by Pablo
I have a project in a personal private git, I downloaded in another computer and when trying to download the packages in packages.jsoni got this error message:
我在个人私有 git 中有一个项目,我在另一台计算机上下载,当我尝试下载包时packages.json收到此错误消息:
pablo@debian:~/Documents/clients/stock$ npm install
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
This is the content of the packages.json
这是内容 packages.json
{
"name": "Stock",
"version": "0.0.1",
"description": "Stock App",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-watch": "^0.6.1",
"grunt-execute": "^0.2.2",
"socket.io": "latest",
"mysql": "latest",
"express": "latest",
"path": "latest",
"express-session": "latest",
"cookie-parser": "latest",
"ejs": "latest"
},
"dependencies": {
"socket.io": "~1.3.7",
"body-parser": "~1.14.1"
}
}
What can I do, to packages to download, and why in my other computer I don't get this error?
我可以做什么,要下载的包,以及为什么在我的另一台计算机上我没有收到此错误?
回答by rjmunro
These warnings are just warnings, and don't indicate anything reason that the dependencies would not have downloaded.
这些警告只是警告,并不表示依赖项不会下载的任何原因。
The package.json file shown is working perfectly for me. To debug your issue, try removing the node_modules folder and running npm installagain. Note that if the packages are already in the node_modules folder, npm installwon't download them again.
显示的 package.json 文件非常适合我。要调试您的问题,请尝试删除 node_modules 文件夹并npm install再次运行。请注意,如果包已经在 node_modules 文件夹中,npm install则不会再次下载它们。
If you want to fix the warnings:
如果要修复警告:
Before devDependencies, add a repository option; i.e. something like:
"repository": { "type": "git", "url": "[git-url-of-your-project]" },The URL doesn't have to be a github one, just whatever you use to
git clonethe project on another computer.Add a file called README or README.md and write a few words about what the project is in it.
在 devDependencies 之前,添加一个 repository 选项;即类似:
"repository": { "type": "git", "url": "[git-url-of-your-project]" },URL 不必是 github 的,只要你
git clone在另一台计算机上的项目中使用。添加一个名为 README 或 README.md 的文件,并写下有关项目内容的几句话。
回答by Abhishek Goel
Mark your application as private to suppress all warningsby adding "private": true
通过添加将您的应用程序标记为私有以抑制所有警告"private": true
{
"name": "Stock",
"version": "1.0.1",
"private": true
}
回答by Sprose
I found removing the node_modules folder and doing 'npm install' from fresh seemed to fix my issues.
我发现删除 node_modules 文件夹并从 fresh 中执行“npm install”似乎可以解决我的问题。
回答by Swaruuu
Just add your package.jsonfile from
只需添加您的package.json文件
C:\Program Files\nodejs\node_modules\npm
to
到
C:\Windows\System32
and everything will be fine and working. Hope it helps.
一切都会好起来的。希望能帮助到你。

