sudo npm install gulp-cli -g
npm init
npm install gulp --save-dev
npm install browser-sync --save-dev // I added this file later, read documentation
I checked package.json which shows gulp too.
made gulp.js file as per documentation
Gulp is installed checked, npm ls. please find screen shot below
https://i.stack.imgur.com/cn3w1.png
Please check below screenshot for gulp error
https://i.stack.imgur.com/VeAns.png
Related
I can't install gulp globally on my windows 7 machine. I used npm install --global gulp-cli but showed this error:
when i used gulp -v I got this error
please help
At least, It solved! I followed this article install gulp till step #2 then I installed gulp globally on terminal using this code npm install gulp-cli -g.
Thank you everyone for help me.
try this commands:
If you've previously installed gulp globally, try to delete it using:
npm rm --global gulp
After that install new version of gulp using:
npm install --global gulp
npm link gulp
and verify yourgulp version:
gulp --version
When I run commands like:
npm run dev
npm run watch
to compile my project. I receive an error that says the laravel-mix directory does not exist.
Error: Cannot find module 'PATH/node_modules/laravel-mix/setup/webpack.config.js'
I have deleted the node_modules directory and used npm install to attempt to get it to install properly and it still is not there. "Laravel-mix" is in the package.json file as a dependency, so to my knowledge running npm install or npm install laravel-mix should do the trick, but it isn't working. Any information about this would be greatly appreciated.
npm -v 6.14.1
node -v 12.16.2
Have you already run the following?
npm install laravel-mix
npm install cross-env
I have attempted to install Gulp using NPM but the gulp command is not getting recognized. These are the commands I ran. I am using Git Bash and running it as admin. I am using Windows 10.
npm install gulp-cli --global
( Attempt to run 'gulp' and 'gulp -v' and nothing works )
Then navigating to my project folder
npm install gulp --save-dev
( Attempt Gulp command again and it still not recognized )
My env path for npm is C:\Users\ *username* \AppData\Roaming\npm
When I run
npm config get prefix
It returns C:\Program Files\Git\Roaming\npm
I am fairly new to NPM but I have been searching for hours and trying everything. I have uninstalled and reinstalled Node and npm multiple times. Sorry if this has been answered before but every other thread I found did not solve this issue.
Install gulp and gulp-cli globally
npm install --global gulp-cli
npm install --global gulp
npm install gulp -D
Update:
Make sure install gulp locally and globally. After that check status using these command :
npm ls
npm ls -g
After that make sure to link gulp
npm link gulp
And maybe you should check you env.
Create an environmental variable called NODE_PATH
Set it to: %AppData%\npm ( It's you npm path )
Close CMD, and Re-Open to get the new ENV variables
Add gulp to scripts in your package.json file:
"scripts": {
"gulp":"gulp"
},
Then you can use the command:
npm run gulp name of task
Writing function like this worked for me:
gulp.task('message', async ( ) => {
console.log('gulp task is working ')
})
This worked for me:
npm config delete prefix
I installed gulp following the standard procedure:
$ npm install --global gulp-cli
adding the project dev dependency
$ npm install --save-dev gulp
and a gulpfile.js
When running gulp from Git Bash I get the error gulp: command not found
I followed related threads here on SO updating my path variable (Windows 7) with C:\Users\username\AppData\Roaming\npm to no avail
I actually didn't find any gulp folders inside C:\Users\username\AppData\Roaming\npm (other packages are still there and function as expected). Instead, gulp seems to get installed to C:\Program Files\Git\usr\local
Running npm root and npm root -g respectively, return
C:\Users\username\node_modules and
C:\Program Files\Git\usr\local\node_modules
I also got the following warnings when running npm install --save-dev gulp
I feel like I mixed up paths somehow, but I'm a bit lost, as I'm new to Node and Gulp.
After open command shell with administrator simply write npm install -g gulp and npm install -g gulp-cli. You can reach from every location to gulp then.
I'm trying to install grunt since the grunt watch for example is not working, shows as error: grunt command not found. When I do npm install grunt#0.4.1 --save-dev this is what appears:
And does not let me install it. I tried doing another package.json, doing a clean npm install and still, no idea what's going on.
Can anyone help me please, how can I solve this problem?
It seems that you need to install the Grunt CLI globally:
npm install -g grunt-cli
With this in place you should be able to setup grunt for any new project.