D:\vue>npm install 报错:WARN saveError ENOENT: no such file or directory, open 'D:\vue\package.json'

解决办法:
1.先用命令初始化一下

npm init -f

2.再用 npm install命令进行打包
这里写图片描述
3.出现错误

npm WARN [email protected] no repository field.

看字面意思大概是vue或者package.json里缺少repository字段,也就是说缺少项目的仓库字段

{
    ...
    "repository": {
        "type": "git",
        "url": "http://baidu.com"
    },
    ...
}

但作为测试项目或者练习用,只需在package.json里面做如下配置即可:

{
    ...
    "private": true,
    ...
}

以这种方式把项目声明为私有

4.然后进行打包

npm install
npm run bulid

这里写图片描述

猜你喜欢

转载自blog.csdn.net/qq_32447301/article/details/81182456