最近在研究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

NodeJS - npm WARN package.json : No repository field:can not open package.json的更多相关文章

  1. (转 留存)Windows环境下的NodeJS+NPM+GIT+Bower安装配置步骤

    Windows环境下的NodeJS+NPM+GIT+Bower安装配置步骤 标签: NodeJSnpmbower 2015-07-17 16:38 3016人阅读 评论(0) 收藏 举报  分类: G ...

  2. python:datetime.datetime is not JSON serializable 报错问题解决

    问题: 项目使用django开发,返回的数据中有时间字段,当json.dumps()时提示:datetime.datetime is not JSON serializable 解决: import ...

  3. npm安装socket.io时报错的解决方法(npm WARN enoent ENOENT: no such file or directory, open '/usr/local/nodejs/bin/package.json')

    执行 npm install socket.io安装时报错: [root@WEB node_modules]# npm install socket.ionpm WARN enoent ENOENT: ...

  4. NPM安装报错:WARN PACKAGE.JSON, NO REPOSITORY FIELDS

    今天在安装npm包时遇到了这个错误,出现如下提示: npm WARN package.json xxx@0.0.0 No repository field. npm WARN package.json ...

  5. npm warn weex @1.0.0 no repository field

    玩weex出现nmp安装问题总是包这个错,但是其实是安装成功的 npm warn weex@1.0.0 no repository field. 看字面意思大概是package.json里缺少repo ...

  6. npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\James\package.json'

    在运行如下命令时, 遇到了问题: npm install --registry=https://registry.npm.taobao.org npm run dev 错误提示: 解决办法: 生成一个 ...

  7. npm install warning: no description; no repository field

    npm install 报错:warning no description; no repository field 开始以为必须npm init,npm init在git bash(win7)里,还 ...

  8. 安装hexo报错(npm WARN deprecated swig@1.4.2: This package is no longer maintained),已解决

    问题:在使用npm安装hexo时报错 $ npm install -g hexo npm WARN deprecated swig@1.4.2: This package is no longer m ...

  9. npm WARN saveError ENOENT: no such file or directory

    转自树之名原文npm WARN saveError ENOENT: no such file or directory解决 我是在安装sequelize时出错的.提示的错误没有保存,类似于参考的文章中 ...

随机推荐

  1. ThinkPHP5 为什么取消了单字母函数?

    ThinkPHP5 为什么取消了单字母函数? 更容易理解. 理加规范. 个人喜好. 比如 TPShop 也是用 ThinkPHP5 又加回单字母函数. [话唠]教练,我想做菜-长沙 2018/10/8 ...

  2. 浅谈Trie

    所谓\(Trie\)就是字典树. 何为字典树?想象一下我们平时用拼音查字法在字典树查汉字的时候,一位一位确定这个汉字的拼音从而翻到我们想要看的那一面. 所以\(Trie\)树跟字典一样,是一种逐位检索 ...

  3. SQL语句 合并列值 将一列的多个值合并成一行

    效果: oralce写法: select WM_CONCAT(A.title) as citys from tmpcity A sql server写法: select stuff((select ' ...

  4. Hibernate学习5—Hibernate操作对象

    第一节:Hibernate 中四种对象状态 删除状态:处于删除状态的Java 对象被称为删除对象.比如说session delete一个对象,这个对象就不处于session缓存中了, 已经从sessi ...

  5. postman关联 (含获取请求头的方法)

    在Tests里面输入脚本 var jsonData = JSON.parse(responseBody);postman.setEnvironmentVariable("message&qu ...

  6. Spring不支持静态注入

    在springframework里,我们不能@Autowired一个静态变量,使之成为一个spring bean,例如下面这样: @Autowired private static YourClass ...

  7. 编写hibernateDao,使dao层都实现hibernateDao

    package com.wiseweb.core.dao; import java.io.Serializable; import java.util.ArrayList; import java.u ...

  8. TCP三次握手和四次挥手、HTTP协议

    TCP三次握手和四次挥手 首先我们知道HTTP协议通常承载于TCP协议之上,HTTPS承载于TLS或SSL协议层之上 通过上面这张图我们能够知道.     在Http工作之前,Web浏览器通过网络和W ...

  9. C++:const_cast类型转换

    针对const_cast,太多人在用同一个示例问同一个问题:void main(){   const int a = 3;   const int *pc = &a;   int *p = c ...

  10. 0908期 HTML form表单

    表单基础摘要 <form id="" name="" method="post/get" action="负责处理的服务端& ...