i have run composer and laravel on my therminal. but when i run laravel new freeCodeGram it said "The Laravel installer requires PHP 7.3.0 or greater - laravel-5

PS C:\Users\TOHEEB> composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.10.7 2020-06-03 10:03:56
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
--no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
about Shows the short information about Composer.
archive Creates an archive of this composer package.
browse Opens the package's repository URL or homepage in your browser.
cc Clears composer's internal package cache.
check-platform-reqs Check that platform requirements are satisfied.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Sets config options.
create-project Creates new project from a package into given directory.
depends Shows which packages cause the given package to be installed.
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader.
dumpautoload Dumps the autoloader.
exec Executes a vendored binary/script.
fund Discover how to help fund the maintenance of your dependencies.
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
i Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
info Shows information about packages.
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Shows information about licenses of dependencies.
list Lists commands
outdated Shows a list of installed packages that have updates available, including their latest version.
remove Removes a package from the require or require-dev.
run Runs the scripts defined in composer.json.
search Searches for packages.
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Shows information about packages.
status Shows a list of locally modified packages, for packages installed from source.
suggests Shows package suggestions.
u Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
update Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
upgrade Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock.
why Shows which packages cause the given package to be installed.
why-not Shows which packages prevent the given package from being installed.
PS C:\Users\TOHEEB> node -v
v12.18.0
PS C:\Users\TOHEEB> npm -v
6.14.4
PS C:\Users\TOHEEB> laravel
Laravel Installer 3.1.0
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
help Displays help for a command
list Lists commands
new Create a new Laravel application
PS C:\Users\TOHEEB> laravel
Laravel Installer 3.1.0
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
help Displays help for a command
list Lists commands
new Create a new Laravel application
PS C:\Users\TOHEEB> laravel new freeCodeGram
In NewCommand.php line 45:
The Laravel installer requires PHP 7.3.0 or greater. Please use "composer create-project laravel/laravel" instead.
new [--dev] [--auth] [-f|--force] [--] [<name>]
PS C:\Users\TOHEEB> php -v
PHP 7.2.28 (cli) (built: Feb 18 2020 12:54:18) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

I have experienced this before, what worked for me was
composer create-project laravel/laravel nameofproject

I'm not familiar with freeCodeGram, but the error is telling you to use Laravel to create a project.
composer create-project laravel/laravel
PHP 7.2 is installed? Check the Laravel documentation on required PHP version to make sure it matches your PHP version.
composer.json will show you what version of Laravel framework is being installed and the required PHP version. Make sure no dependencies require a higher version than what you have installed too.
You can create a project with a specific Laravel version like this:
composer create-project laravel/laravel="5.5.*" myApp

Related

First composer package published not found

i know this has already been asked but, i can't see what is going wrong without asking.
I've created a packagist for a custom code hosted on github.
Packagist : https://packagist.org/packages/claims/module-logger
Github : https://github.com/Minirock/claims-module-logger
But when i try to load it using composer, it says it can't find it.
composer require claims/module-logger
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Info from https://repo.packagist.org: #StandWithUkraine
In InitCommand.php line 785:
Could not find a version of package claims/module-logger matching your minimum-stability (dev). Require it with an explicit version constraint allowing its desired stability.
I'm pretty sure this has to do with composer version but, how can i check if my package is available for composer 1 and / or 2. If not available for composer 1 (which is mandatory in my case) how can i make it accessible ?
I also tried specifying the version
composer require claims/module-logger:dev-main
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Info from https://repo.packagist.org: #StandWithUkraine
In InitCommand.php line 792:
Could not find package claims/module-logger.
Did you mean this?
claims/module-logger
I has exactly the same problem.
I updated my composer version (using composer self-update).
I confirm the problem persist.
The github : https://github.com/j-barth/test
The packagist : https://packagist.org/packages/jbarthes/test
Thank you

How to install Laravel Vite?

The Laravel Vite Doc sais to run:
npx apply laravel:vite --ignore-existing
inside your project root to install vite in your laravel project.
When I try to do that in a freshly installed laravel project it shows this:
zsh:1: command not found: laravel:vite
What am I doing wrong?
Using Macos Big Sur with PhpStorm.
That command no longer applies to newly created projects (as of laravel-vite 0.1.27, released a few days ago), and it now results in a different error:
$ npx apply laravel:vite --ignore-existing
[ info ] Applying preset laravel:vite.
[ error ] The preset could not be evaluated.
evalmachine.<anonymous>:13
var preset_default = definePreset({
^
ReferenceError: definePreset is not defined
at evalmachine.<anonymous>:13:22
at Script.runInContext (node:vm:139:12)
at Object.runInContext (node:vm:289:6)
at ModuleImporter.evaluateConfiguration (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:68:26)
at ModuleImporter.import (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:17:27)
at PresetApplier.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Applier/PresetApplier.js:22:87)
at async CommandLineInterface.apply (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:57:16)
at async CommandLineInterface.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:54:16)
However, the command shown in the laravel-presets/vite repository (the source repo for the laravel:vite preset) worked for me -- i.e., it augmented the Laravel project with Vite:
# Run this command from root of Laravel project
npx #preset/cli apply --debug laravel:vite
#preset/cli currently suppresses all output (including errors), so the --debug flag above is important. Since the verbose log is difficult to follow, I recommend redirecting the output to a file, and searching it for the word exception.
Tips
To ensure the preset succeeds, you must have php#8.0 (e.g., from Homebrew) and composer installed and available from the command line. Add the paths to those binaries to your PATH environment variable.
The Vite server must be started separately from the PHP server. Run npm run dev in one terminal; and php artisan serve from another.
Vite is now the default frontend asset bundler in laravel which replaces webpack. No additional installations are needed for new projects.
https://laravel-news.com/vite-is-the-default-frontend-asset-bundler-for-laravel-applications

voyager - (Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "voyager" namespace)

So I am trying to install Voyager for my laravel, but when I insert
php artisan voyager:install
I am getting this error message:
(Symfony\Component\Console\Exception\CommandNotFoundException] There
are no commands defined in the "voyager" namespace)
Here is my PhP and Laravel version:
Laravel Framework version 5.3.16
λ php -v PHP 7.0.13 (cli) (built: Nov 8 2016 13:45:28) ( ZTS )
Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright
(c) 1998-2016 Zend Technologies
And my package service providers:
/*
* Package Service Providers...
*/
TCG\Voyager\VoyagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
So what is the problem? why am I getting this error message
Looks like you didn't install it. Comment out or remove service providers from the list and run these commands:
composer require tcg/voyager
composer dumpauto
According to the docs, next step will be adding a service provider to the config/app.php:
TCG\Voyager\VoyagerServiceProvider::class,
And only then run php artisan voyager:install command.
php artisan config:clear
solved my problem
If you have successfully executed the command line:
composer require tcg/voyager
You must have the line "tcg/voyager": "^1.2" in the require section of your composer.json file, in this case the command line "composer dumpautoload" will automatically perform all the packages discovery for you. Otherwise do the following :
add the line of code: TCG\Voyager\VoyagerServiceProvider::class to the file "config/app.php". Then run the following command line :
composer dumpautoload

Arrow keys not working in shell

I'm getting started with a Laravel 5 project and trying to run some experiments using 'php artisan tinker' (psy shell), but I'm running into some weirdness. In the tinker/psy shell, pressing any of the arrow keys is printing character literals to the screen rather than performing the intended behaviour (move character for left and right, cycle recent commands for up and down).
Up is outputting ^[[A.
Down is outputting ^[[B.
Right is outputting ^[[C.
Left is outputting ^[[D.
This is probably an issue with my terminal and not a Laravel bug. I am getting the same buggy behaviour when running php -a.
I am running terminal on OSX, with an xterm emulation.
The PHP REPL does not implement readline's line editing and history capabilities. I don't know if there's a PHP module that implements it, but you can do:
rlwrap php artisan tinker
You may have to install rlwrap for your OS.
This is due to PHP not being built with readline support. You can enable this when you compile and build PHP with the --with-readline argument.
http://php.net/manual/en/features.commandline.interactive.php
MY os: centos
I solved the problem by :
sudo yum install rlwrap
alias tinker='rlwrap php artisan tinker'
In my case, I need install php7-readline
sudo zypper in php7-readline
[sudo] password for root:
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following NEW package is going to be installed:
php7-readline
1 new package to install.
Overall download size: 64.0 KiB. Already cached: 0 B. After the operation, additional 30.9 KiB will be used.
Continue? [y/n/...? shows all options] (y):
Retrieving package php7-readline-7.2.1-1.1.x86_64 (1/1), 64.0 KiB ( 30.9 KiB unpacked)
Retrieving: php7-readline-7.2.1-1.1.x86_64.rpm ......................................................................................[done (8.4 KiB/s)]
Checking for file conflicts: ....................................................................................................................[done]
(1/1) Installing: php7-readline-7.2.1-1.1.x86_64 ................................................................................................[done]

yii2 composer.phar update is not working

I'm using xampp on Windows 8 and I want to run composer.phar update for installing Yii2-useraccording do the description here:
http://yii2-user.readthedocs.org/en/latest/getting-started/installation.html
But when I do that, no update happens.
Instead, I got shown the version number of composer and a list of the possible commands with composer.
There is no error-message and update is in the list of the possible commands.
I have tried composer update too, but with that I'm getting an error message:
Problem 1
- yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*#stable | 1.11.*#stabl
e -> no matching package found.
- yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*#stable | 1.11.*#stabl
e -> no matching package found.
- yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*#stable | 1.11.*#stabl
e -> no matching package found.
- Installation request for yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0
.0, 2.0.1].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your min
imum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.
Seems like you missed execution of this command:
composer global require "fxp/composer-asset-plugin:~1.1.1"
It should be executed only once.
You can find more information about it in official documentation and plugin Github page.
this problem is recursive since 2014, like other than AssetsManager, permissions .... and somes php Warning or Fatal, at the begin of installation. I do not know how "Composer" elsewhere. But frankly with Yii2 is a calamity. Then as yii2 already does not need it for bugs. The accumulation of 2 it is a disaster. So...
composer global require "fxp/composer-asset-plugin:~1.0"
With ~ you get the last version of composer-asset-plugin...
But that's often not enought !!!!

Resources