首页 > 其他 > 详细

npm saveError ENOENT: no such file or directory

时间:2018-08-27 19:50:05      阅读:362      评论:0      收藏:0      [点我收藏+]

1、报错情况

在执行npm install xxx时,出现如下:
npm WARN saveError ENOENT: no such file or directory, open ‘/nodetest1/package.json‘
npm WARN enoent ENOENT: no such file or directory, open ‘/nodetest1/package.json‘

2、原因

项目目录中没有package.json

3、解决
使用 npm init -f 命令来生成一个package.json

4、生成package.json在执行npm install xxx

npm WARN nodetest1@1.0.0 No description
npm WARN nodetest1@1.0.0 No repository field.
npm WARN file-explorer@0.0.1 No repository field or no license field

5、显示缺少description描述和repository字段

根据模板package.json,添加description中的值以及repository字段
{
"name": "WeiXinNode",
"version": "1.0.0",
"description": "description字段",
"main": "index.js",
"dependencies": {
"koa": "^2.1.0",
"sha1": "^1.1.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"repository": { ------repository
"type": "",
"url": ""
},
}

 

npm saveError ENOENT: no such file or directory

原文:https://www.cnblogs.com/xiluonanfeng/p/9543707.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!