Composer not installing Fork CMS on Windows - windows

I have Windows 10, actual XAMPP and actual Composer.
Fork CMS is under E:\xampp\htdocs\fork. In this directory there is a composer.json file with the following lines:
...
"scripts": {
"post-install-cmd": "php app/console assetic:dump . && cd tools && bash ./remove_cache",
"post-update-cmd": "php app/console assetic:dump . && cd tools && bash ./remove_cache"
},
...
When I run "composer install" in this directory I get the following error:
[RuntimeException] Error Output: Command "bash" is misspelled or not
found (* translated from German)
Anyone has a clue for me? I know that bash is from linux, but I don't know how it can be used in my circumstances. Thanks for any help.

The error is as clear as it can get: There is no bash command available on your machine. This is a very likely error, as Windows systems don't have a bash command.
So the solution is easy to find as well: Install the bash command. Git by windows comes with a bash command for instance. Other solutions are also available.

Related

Running composer install not working with Jenkins in a microservices architecture

I am automating a microservices architecture with a Jenkins pipeline and having this issue although the file composer.json exists in that folder
C:\Program Files
(x86)\Jenkins\workspace\C2Project\C2\autority-service>composer update
Composer could not find a composer.json file in C:\Program Files (x86)\Jenkins\workspace\C2Project\C2\autority-service
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
here is the concerned jenkins stage:
stage('Build autority-service'){ steps { dir('C:\\Program Files (x86)\\Jenkins\\workspace\\C2Project\\C2\\autority-service') {
bat "sudo composer update"
bat "sudo composer dump-autoload"
bat "sudo composer install"
sh "php artisan key:generate"
bat "php artisan cache:clear"
bat "php artisan config:clear"
bat "php artisan migrate"
bat "php artisan db:seed" } } }
Can anyone please help me fix this issue?
I resolved this issue by adding a composer.phar file because Jenkins couldn't recognize the composer.json file as they are similar with this command line curl -sS getcomposer.org/installer | php then installed composer on the Jenkins server using the composer.phar file php composer.phar install

Composer: Command Not Found on Mac

I have installed Composer as per the instructions command not found
After installing I get the prompt that Composer is successfully installed but when I go to check the version it gives me error "Composer: Command Not Found"
I have been looking how to fix this issue and I had to read and understand little bit and the environment variables on MAC.
I understand the issue looks simple but it will get over complicated if you didn't understand how to install composer probably.
Solution 1
I found this solution here: https://duvien.com/blog/installing-composer-mac-osx
Open a terminal and navigate to your user directory, ie cd /User//
Run this command shown below to download Composer. This will create a Phar (PHP Archive) file called composer.phar:
curl -sS https://getcomposer.org/installer | php
Now we move composer.phar file to a directory
sudo mv composer.phar /usr/local/bin/
We want to run Composer with having to be root al the time, so we need to change the permissions:
sudo chmod 755 /usr/local/bin/composer.phar
Next, we need to let Bash know where to execute Composer:
nano ~/.bash_profile
Add this line below to bash_profile and save
alias composer="php /usr/local/bin/composer.phar"
and then run this command:
source ~/.bash_profile
Finally, run:
composer --version
Solution 2:
I understand that the first command you will find online when you try to google this issue would be
curl -sS https://getcomposer.org/installer | php
But actually this is the main terminal installation but sometimes I wanted to manually install the composer, so this 2nd solution about manually installing the composer in specific directory
First of all you need to understand where are you now on the terminal
use
pwd
and then install composer manually using the following commands
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') ==='baf1608c33254d00611ac1705c1d9958c817a1a33bce370c0595974b342601bd80b92a3f46067da89e3b06bff421f182') { echo 'Installer verified'; } else { echo 'Installer corrupt';
unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
to use it on that case you will read on the terminal to use this composer installation use
Use it: php composer.phar
so just write
php composer.phar
and it should be working.... one more thing, during this installation you can install the composer to specific directory / project folder... in that case you can use a flag with command No.4 to tell the terminal to install the composer in specific directory...this flag is --install-dir=your-directory-path
and you will the terminal this time after installing composer asking you to use the following path to call the composer
Use it: php /Users/muatafa/composer.phar
if you want to read more about this issue, I think you must read the composer documentation how to install it>>> https://getcomposer.org/download/
that's how I solved my current issue... if you still have any issues comment on this replay & Hopefully we can figure it out!
I had the same problem. "composer require something" works if installed in global and not locally.
If you install composer locally you'll then install dependencies using "php composer.phar require nameofyoudependency"
To install globally open a terminal to install as mentionned on the composer website. Then run "sudo mv composer.phar /usr/local/bin/composer"
Now you can use "composer" directly to install dependencies like => "composer require something/sdk"
the composer you installed is still named /usr/local/bin/composer.phar - look in the second yellow/brownish line in your output. Just rename it to just composer
Your composer command is not set to path, use
export PATH=$PATH:/usr/local/bin/
I had the same issue, After installing composer using the command line on their website. I forgot to put composer.phar into a directory on my PATH, so it can simply be called from any directory (Global install). and then I ran this command "sudo mv composer.phar /usr/local/bin/composer" and it was resolved
I figured out. in place of "composer require twilio/sdk" I needed to use
"composer.phar require twilio/sdk" since I am on mac. It worked

command line composer command not defined

I am following the composer developer Tutorial: https://hyperledger.github.io/composer/tutorials/developer-guide.html
Everything worked till the point when I am running from the command line:
$ composer archive create -a dist/my-network.bna --sourceType dir --sourceName .
-bash: fds: command not found
The composer command was not found. When built by npm install the script can execute the composer command within the package.json
Next I installed php composer from: https://getcomposer.org - Which might be the wrong package?
$ composer network deploy
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "network" is not defined.
My 2 questions: is this the right package, if not how can I remove it safely?
Furthermore, how can I execute the composer command.
You need to npm install -g composer-cli -- please refer to the documentation.

Error trying to run composer with Laravel 4

I am new to Laravel and to using the terminal.
I installed composer globally and it is running, but when I try to mv I get an error:
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer
No such file or directory
I echo $PATH and get this:
/Users/ebernal/.rvm/gems/ruby-1.9.3-p286/bin:/Users/ebernal/.rvm/gems/ruby-1.9.3-
p286#global/bin:/Users/ebernal/.rvm/rubies/ruby-1.9.3-
p286/bin:/Users/ebernal/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Not sure what all this means, and why can't Terminal not find /usr/local/bin?
I can run composer using composer.phar and it mostly runs, but at the very end I get this error:
Script php artisan clear-compiled handling the post-install-cmd event returned with an
error
[RuntimeException]
Error Output:
Thanks for your help
As it says in the error message, no such file or directory.
Locate the /usr/local/bin/composer file. Show hidden folders or use the cd command to navigate through Terminal.
You possibly don't have a composer folder, hence why it can't move it into it.

"PHP Parse error..." when trying to run phpunit.phar

I am trying to set up phpunit on my server. This is what I did so far...
SSH into Apache server via PuTTY
Ran command... cd /path/to
Ran command... wget http://pear.phpunit.de/get/phpunit.phar
Ran command... chmod +x phpunit.phar
Ran command... /path/to/phpunit.phar
The error I received is...
PHP Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /path/to/phpunit.phar on line 6
The first 8 lines of the phpunit.phar file are...
#!/usr/bin/env php
<?php
define('__PHPUNIT_PHAR__', realpath($GLOBALS['_SERVER']['SCRIPT_NAME']));
spl_autoload_register(
function ($class)
{
static $classes = NULL;
Any ideas what I'm doing wrong?
You need at least PHP 5.3.3 to use PHPUnit's phar version:
Note:
PHPUnit 3.7 requires PHP 5.3.3 (or later) but PHP 5.4.7 (or later) is highly recommended.

Resources