最近在研究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. c++重在运算符前置自增和后置自增

    class student { int age; }; int main() { class student stu; (stu++)++;//error ++(stu++);//error stu+ ...

  2. Cannot read property 'setState' of undefined

    You're using function() in your Promise chain, this will change the scope for this. If you're using ...

  3. Xbox360游戏收藏

    xbox360游戏下载地址 http://dl.3dmgame.com/SoftList_221.html   XBLA游戏总结.http://tieba.baidu.com/p/3174478602 ...

  4. JDK 8 - Method Reference 分析

    Java SE 8 在 Java 语言层面上新增了 lambda expression 的功能,使得 Java 具备了函数式语言的能力 - 可以将函数作为方法参数传递,即 code as data. ...

  5. if __name__=="__main__": 这个结尾的理解

    print "别人应用我做为模块导入,就只看到我" if __name__=="__main__": print "自己文件执行就看到我输出" ...

  6. 网络网关TCP/IP

    vmware中的4种网络连接模式 2008-11-13 11:11:21 分类: 系统运维 很多朋友都用vmware来测试不同的系统,我结合自己的经验谈一下对网络设置的理解,不对的地方请指正. bri ...

  7. Java经典练习题_Day05

    一. 选择题 1.下列各项中的各项定义正确的是:(ACD) A.  public static void m(){}   B.  public void static m(){} C.  public ...

  8. laravel 做图片的缩略图 踩坑

    系统需求 PHP >= 5.3 Fileinfo Extension GD Library (>=2.0) … or … Imagick PHP extension (>=6.5.7 ...

  9. Linux上面缺少rz和sz命令

    一.centos系统没有自带rz/sz命令 yum install lrzsz 搞定! 二.对于经常使用Linux系统的人员来说,少不了将本地的文件上传到服务器或者从服务器上下载文件到本地,rz / ...

  10. python复习之路-Day01

    数据类型初识 1.数字 2 是一个整数的例子.长整数 不过是大一些的整数.3.23和52.3E-4是浮点数的例子.E标记表示10的幂.在这里,52.3E-4表示52.3 * 10-4.(-5+4j)和 ...