Laravel 安装程序方法

编程入门 行业动态 更新时间:2024-10-10 08:27:39
本文介绍了Laravel 安装程序方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

通常我会按照以下有关文档的命令来安装 Laravel 5.1:

composer create-project laravel/laravel --prefer-dist

效果很好.

但我在通过 Laravel 安装程序"下的

注意,解决问题后我可以确认通过 Laravel Installer 方式安装比 composer 快.

解决方案

您在本地安装的 Composer Assets Plugin 正在使用 Composer 已弃用的方法.该插件已修复,因此请运行 composer global update 以获取带有错误修复的最新版本.之后,您应该可以成功运行命令了.

如果这不起作用(因为您可能会在运行上一个命令时遇到相同的错误),请尝试删除全局供应商目录.运行任何全局 Composer 命令时,它会输出类似将当前目录更改为 XXX"的内容.删除 XXX/vendor 目录,然后尝试运行该命令.

Normally I do install Laravel 5.1 by following this command regarding to documentation:

composer create-project laravel/laravel --prefer-dist

It works fine.

But I read in the documentation under "Via Laravel Installer" also it is possible to install via Laravel Installer, which is much faster than installing via Composer:

laravel new blog

But to use this method I need to run following command once:

composer global require "laravel/installer=~1.1"

When I do run it I get following errors many times

Deprecation Notice: ComposerPackageVersionVersionParser::parseLinks is deprecated. Use ComposerPackageLoaderArrayLoader::parseLinks() instead in phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Package/Version/VersionParser.php:226

after many line of same error ./composer.json has been updated appears and it continues with the same line of errors, it ends with following

Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files

What is wrong with it? Any idea or solution.

My environment: Windows 10, GitBash and cmder console.

Update of composer, I did ran composer self-update also

Snapshot of console


EDIT: Note, I can confirm after solving the issue that the installation via Laravel Installer method is faster than composer.

解决方案

The Composer Assets Plugin you've installed locally is using a deprecated method of Composer. The plugin is already fixed, so run composer global update to get the latest versions with the bug fix. After it, you should be able to run the command succesfully.

If this doesn't work (as you might get the same error running the previous command), try removing the global vendor directory. When running any global Composer command, it outputs something like "Changed current directory to XXX". Remove the XXX/vendor directory and then try running the command.

更多推荐

Laravel 安装程序方法

本文发布于:2023-11-02 07:22:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551734.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:安装程序   方法   Laravel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!