gulp command not working on laravel Elixir on windows - php

I was trying to run the gulp command in the windows command promptafter installing node_modules in my laravel installation but it came back with this error in my windows command prompt :-
'gulp' is not recognized as an internal or external command,
operable program or batch file.
I was trying to use Lavarel Elixir and as in the Laracast videos I was trying to get the gulp command working on my command prompt but it shows
I installed node_modules using the below command
npm install --no-bin-links
it installed all the files
I am using Netbeans as my IDE and it is showing an error in the node_modules folder also , so I am unsure as to how to get this fixed and Working
My Work Environment is
Apache through MAMP
OS :- Windows 10
IDE :- Netbeans
Thanking you in anticipation

In order to be able to run gulp you need to install the gulp command line interface globally like so: npm install -g gulp-cli. Afterwards you need to add a gulpfile.js where you would configure your builds/tasks. For more information check out the official "Getting started" guide and the docs on gulp: https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md

Related

zsh: command not found: php. PHP is installed and working with MAMP

I am trying to use composer to install a google client library, but cannot install composer or use php on the command line.
I am using php 8.0.8 with MAMP and it is working fine, so I know it is installed.
If I type php in the terminal, I receive the command not found message. Thinking it could be an environment variable, I have tried navigating to the php folder /Applications/MAMP/bin/php/php8.0.8/lib/php and tried the php command again, but still get the same error
I am using a Mac running Monterey
Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management
Instructions to Change PHP Installation
First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
This should output the path to the default PHP install which comes preinstalled by Mac OS X, by default it has to be (Assuming you've not changed it before):
/usr/bin/php
Now, We just need to swap this over to the PHP that is installed with MAMP, which is located at /Applications/MAMP/bin/php/php5.4.10/bin (MAMP 2.1.3)
To do this, We need to edit the .bash_profile and add the MAMP version of PHP to the PATH variable.
Follow these simple steps:
Within the Terminal, run vim ~/.bash_profile
Type i and then paste the following at the top of the file:
export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH
Hit ESC, Type :wq, and hit Enter
In Terminal, run source ~/.bash_profile
In Terminal, type in which php again and look for the updated string. If everything was successful, It should output the new path to MAMP PHP install.
In case it doesn't output the correct path, try closing the terminal window (exit fully) and open again, it should apply the changes (Restart in short).
Install Composer Package Management
Now you can fire the command to install the composer globally (So you can access it from anywhere):
$ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
You can verify your installation worked by typing the following command within the Terminal:
composer
It'll show you the current version and a list of commands you can use if the installation was successful.
Original source

Not able to run `npm install && npm run dev in Laravel 7 to use Bootstrap

I'm using Laravel 7 on my windows 10 machine. While try to use Bootstrap, after executed the command php artisan ui bootstrap, i got the blow message.
Bootstrap scaffolding installed successfully.
Please run "npm install && npm run dev" to compile your fresh scaffolding.
When run npm install && npm run dev, i got the error:
The token && is not a valid separator in this version.
What should I do now? I've already installed node.js and even enabled the path in environment variable.
Appreciate if someone could help on this!
Because you are using Powershell. Three alternatives you have:
Try to use CMD or Gitbash.
you can use try this command:
(npm run build) -and (node ./dist/main.js)
Run them separetly. npm install and npm run dev

getting empty app.js file after running npm run dev

i'm using laravel 7.0 on windows 10. I'm following freecodecamp tutorial on youtube for laravel.
when i run npm run dev i got errors i updated npm by using this command "npm install npm#latest" and everything working fine and i ran npm run dev and i got no errors. but in resources folder and further in js folder i got nothing but "require('./bootstrap');" only and also in sass folder i did not get variable.scss file but in tutorial he have all things good like in app.js file it has vue.js content.

error: git was not found - installing laravel with composer windows

I'm getting an error saying:
failed to clone https://github.com/php-fig/log.git, git was not found, check that it is installed and in your PATH env.
'git' is not recognized as and internal or external command, operable program or batch file
when I try and run composer create-project laravel/laravel learning-laravel.
I installed the git GUI which also comes with a command line shell, but I don't know why its not recognising the command (I'm issuing the create-project command in the normal windows command line prompt).
I also tried running the command from the git shell, which worked, but when I tried php artisan serve it gave me an error saying CLI has stopped working.
Does anyone know how to fix the git error? I'd rather use the windows command shell instead of the git one as it can then go into my wamp/www file
You need to add the directory you installed git to to your PATH environment variable.
Right click on Computer.
Click Advanced System Settings
Click Environment Variables inside the Advanced Menu
Under System Variables, scroll to PATH
Add ;"C:\path\to\git\bin";"C:\path\to\git\cmd"
Test the git command in the command prompt to see if it worked. Git is usually located in Program Files or Program Files(x86).
There is an easier (but temporal) way to add a path variable in Windows.
Paste this in your command prompt:
SET PATH=%PATH%;C:\Program Files\Git\bin
This will work for the rest of the command prompt session. Don't forget installing Git before this.
You'll need to add git to your system PATH if you want to use it in regular command prompt.
Here's a guide on modifying your system path in Windows:
http://www.computerhope.com/issues/ch000549.htm
you need to uninstall git and reinstall ( or update ) in the options you need to change from git bash only to allow git to be added to command line as well, also since it then adds it to your path you may or may not need to restart your computer
I was having some issues using git on Windows. I found this information only and it worked for me.
http://ccn.ucla.edu/wiki/index.php/Setting_Up_and_Using_Git#Windows

Update composer dependencies from command line

I am currently working with symfony2 and I want to launch to download the libraries I need. I know the command in linux is "$ ./composer.phar update --dev" however when I run this in windows it prompts whether I should open the file with the windows explorer or not. I currently have composer.phar installed on windows but I am having trouble launching it. How would I be able to update my symfony2 folder with the dependencies I need. Thank you.
In CMD:
php C:\ProgramData\ComposerSetup\bin\composer.phar self-update
The problem is that Windows don't know how to open .phar files. You need to execute them using php interpreter php composer.phar update and the php interpreter(php.exe) must be accessible on PATH.
You could use command php -v to check if your php is accessible from command line.
Go to C:\ProgramData\ComposerSetup\bin\composer.phar
In CMD write php composer.phar (update) or (self-update)
1: Open cmd
First go to your work directory like if you have wamp then c:/wamp/www.
Then enter composer if you can see list of composer command then its good.
Now type "composer self-update".
5: Next you can see the process.
This worked for me on my Centos server
sudo -u nginx php composer.phar update

Categories