Composer require 报错 reverting ./composer.json and ./composer.lock to ...

简介: Composer require 报错 reverting ./composer.json and ./composer.lock to ...

  • 在安装 laravel-ide-helper 的时候,报错 Installation failed, reverting ./composer.json and ./composer.lock to their original content.


$ composer require barryvdh/laravel-ide-helper


报错:




  • 解决方法


1、把需要引入的包写入 composer.json 中(写入的话,就不需要 composer require 了,直接composer update 即可。)


2、删除 composer.lock


3、$ composer clearcache 清除缓存


4、$ composer update 更新依赖(重新生成 composer.lock)


例如:


上面的 laravel-ide-helper 组件,将它加入到 composer.json 的 require 对象里面,如果只是开发环境使用,就加入到 require-dev,然后按照上面步骤操作一遍:


"require": { "php": "^7.1.3", "fideloper/proxy": "^4.0", // 需要安装的 laravel-ide-helper 与指定版本 "barryvdh/laravel-ide-helper": "^2.6", "laravel/framework": "5.8.*", "laravel/tinker": "^1.0" }, "require-dev": { "beyondcode/laravel-dump-server": "^1.0", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^3.0", "phpunit/phpunit": "^7.5" },


相关文章
|
6月前
|
资源调度 JavaScript Windows
yarn install命令报错解决办法-warning package-lock.json found.
yarn install命令报错解决办法-warning package-lock.json found.
106 0
|
JSON 边缘计算 数据格式
KubeEdge安装加入边缘节点报错: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into
KubeEdge安装加入边缘节点报错: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into
202 0
配置project.config.json文件报错 解析 project.config.json 文件失败,请检查其内容或删除此文件。
配置project.config.json文件报错 解析 project.config.json 文件失败,请检查其内容或删除此文件。
389 0
配置project.config.json文件报错 解析 project.config.json 文件失败,请检查其内容或删除此文件。
|
1天前
|
SQL DataWorks 关系型数据库
DataWorks操作报错合集之DataWorks在同步mysql时报错Code:[Framework-02],mysql里面有个json类型字段,是什么原因导致的
DataWorks是阿里云提供的一站式大数据开发与治理平台,支持数据集成、数据开发、数据服务、数据质量管理、数据安全管理等全流程数据处理。在使用DataWorks过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
12 0
|
10天前
|
JSON 运维 Kubernetes
云效产品使用报错问题之流水线中配置了AppStack,构建时下载的制品内容为json字符串,如何解决
本合集将整理呈现用户在使用过程中遇到的报错及其对应的解决办法,包括但不限于账户权限设置错误、项目配置不正确、代码提交冲突、构建任务执行失败、测试环境异常、需求流转阻塞等问题。阿里云云效是一站式企业级研发协同和DevOps平台,为企业提供从需求规划、开发、测试、发布到运维、运营的全流程端到端服务和工具支撑,致力于提升企业的研发效能和创新能力。
|
20天前
|
JSON JavaScript 前端开发
【报错】unexpected non-whitespace character after JSON
【报错】unexpected non-whitespace character after JSON
|
5月前
|
JSON 数据格式
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
|
3月前
|
SQL 消息中间件 Java
Flink报错问题之使用debezium-json format报错如何解决
Apache Flink是由Apache软件基金会开发的开源流处理框架,其核心是用Java和Scala编写的分布式流数据流引擎。本合集提供有关Apache Flink相关技术、使用技巧和最佳实践的资源。
|
3月前
|
SQL Java 关系型数据库
flink问题之使用debezium-json format报错如何解决
Apache Flink是由Apache软件基金会开发的开源流处理框架,其核心是用Java和Scala编写的分布式流数据流引擎。本合集提供有关Apache Flink相关技术、使用技巧和最佳实践的资源。
54 0
|
5月前
|
小程序 API 定位技术
【uni-app报错】选择地址:fail the api need to be declared in the requiredPrivateInfos field in app/ext.json
【uni-app报错】选择地址:fail the api need to be declared in the requiredPrivateInfos field in app/ext.json
129 0