NodeJS - npm WARN package.json : No repository field:can not open package.json

最近在研究node.js,在安装npm的时候发现了几个报错,瞬间蒙圈,查找文献基本解决(文献好少呀~  -。-)
 
一、报错:“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

转载于:https://www.cnblogs.com/tig666666/p/6526840.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值