B
B
BonBon Slick2017-02-06 00:17:07
Windows
BonBon Slick, 2017-02-06 00:17:07

Setting $PATH variable for composer?

I love ( sarcasm ) Windows, any, and so I have the 10th.
Everything is done with administrator rights. These variables go up. PhP 7 I put below composer.
OpenServer and its console, I also tried all this with Windows Shell.
Here's what I did already, I registered this path in the Environment variables

C:\Users\%USERPROFILE%\AppData\Roaming\Composer\vendor\bin

I also tried like this:
composer global require "laravel/installer=~1.1"

setx /M path "%path%;%appdata%\Composer\vendor\bin"

laravel new blog

And even like this:
C:\Users\%USERPROFILE%\Desktop\OpenServer\modules\php\PHP-7
//или
C:\Users\%USERPROFILE%\Desktop\OpenServer\modules\php\PHP-7\php.exe
// или
%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
//или 
C:\Users\%USERPROFILE%\AppData\Roaming\Composer\vendor\bin

Okay, let's look deeper, I went along the path that is specified in $PATH , there is my command in laravel_new_blog .bat file.
All $PATH variables are registered both in User variables and in System variables.
The computer rebooted a hundred times, and cmd a couple of thousand ...
All these graceful attempts to register 1 line in the incredibly delicious Windows 10 lead to:
> laravel new blog
'laravel' is not recognized as an internal or external command,
operable program or batch file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2017-02-06
@BonBonSlick

I love (sarcasm)
Why are you using it then?
Everything is done with administrator rights.
You don't have to do that.
PATH is truncated to 1024 characters.
Try writing this before the command:SET PATH="%appdata%\Composer\vendor\bin;%path%"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question