NodeJS - npm WARN package.json : No repository field:can not open package.json
2017-03-09 17:42
906 查看
最近在研究node.js,在安装npm的时候发现了几个报错,瞬间蒙圈,查找文献基本解决(文献好少呀~ -。-)
一、报错:“can not open path/path/package.json”
原因:在安装npm的时候,终端会调取一个叫package.json的文件,里边包含了 name,version,dependencies 等等属性信息,当终端找不到该文件的时候也就不能完成安装操作。
解决方法:在对应的path下边创建该文件,并且把需要的模块写在dependencies属性里,比如
。然后使用npm install创建就好了。
二、 No repository field 这个问题如下解答,不想翻译了,筒子们可以自己看~~~(有时间也许会回头翻一下 =、=)
In this post we are going to discuss about npm warning message "npm WARN package.json No repository field". This warning comes up when you are trying to install any npm packages. This is just a warning so actually you do not have to worry about it.
This warning means that the package does not have the repository field in the package.json. This field is used just for informational purposes. Suppose you are an author of a package and you are getting this error, you can write the below code in your package.json to remove this warning.
"repository": {
"type" : "git",
"url" : "Your_Package_URL"
}
According to NPM , repository means the place where your code lives. This is helpful for people who wants to contribute. If the git repository is on GitHub, then the npm docs command will be able to find you.
You can also check the issues already logged https://github.com/npm/npm/issues/3568
. Please Like and Share the Blog, if you find it interesting and helpful.
原文点这里 PC_package.json
一、报错:“can not open path/path/package.json”
原因:在安装npm的时候,终端会调取一个叫package.json的文件,里边包含了 name,version,dependencies 等等属性信息,当终端找不到该文件的时候也就不能完成安装操作。
解决方法:在对应的path下边创建该文件,并且把需要的模块写在dependencies属性里,比如
"dependencies": { "express": "4.15.2"}
。然后使用npm install创建就好了。
二、 No repository field 这个问题如下解答,不想翻译了,筒子们可以自己看~~~(有时间也许会回头翻一下 =、=)
In this post we are going to discuss about npm warning message "npm WARN package.json No repository field". This warning comes up when you are trying to install any npm packages. This is just a warning so actually you do not have to worry about it.
This warning means that the package does not have the repository field in the package.json. This field is used just for informational purposes. Suppose you are an author of a package and you are getting this error, you can write the below code in your package.json to remove this warning.
"repository": {
"type" : "git",
"url" : "Your_Package_URL"
}
According to NPM , repository means the place where your code lives. This is helpful for people who wants to contribute. If the git repository is on GitHub, then the npm docs command will be able to find you.
You can also check the issues already logged https://github.com/npm/npm/issues/3568
. Please Like and Share the Blog, if you find it interesting and helpful.
原文点这里 PC_package.json
相关文章推荐
- npm warn package.json @1.0.0 no repository field
- mac os npm WARN saveError ENOENT: no such file or directory, open '/Users/summer/package.json'
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- npm warn weex @1.0.0 no repository field
- npm 安装出现npm WARN file-explorer@0.0.1 No repository field or no license field
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- npm WARN enoent ENOENT: no such file or directory, open 'D:\web\Imooc\package.json' npm WARN Imooc
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- npm WARN enoent ENOENT: no such file or directory, open 'C:\Program Files\nodejs \package.json'
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- Nodejs 包与 NPM 第三方模块安装和 package.json 以及 CNPM
- npm install warning: no description; no repository field
- nodejs package.json作用及其npm init的使用
- 详解Nodejs之npm&package.json
- nodejs中用npm初始化来创建package.json的实例讲解
- nodejs中用npm初始化来创建package.json的方法
- Nodejs之npm&package.json
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm