warmachine#HH-00 MINGW64 /c/HTML5/app (dev)
$ gulp -v
bash: gulp: command not found
You need to install it globally if you want to use it like that:
npm install -g gulp
Alternatively using Yarn:
yarn add global gulp
In both cases you need to have the NPM/Yarn globals path in PATH.
# Uninstall previous Gulp installation and related packages, if any
$ npm rm gulp -g
$ npm rm gulp-cli -g
$ cd [your-project-dir/]
$ npm rm gulp --save-dev
$ npm rm gulp --save
$ npm rm gulp --save-optional
$ npm cache clean # for npm < v5
# Install the latest Gulp CLI tools globally
$ npm install -g gulp
# Install Gulp 4 into your project as dev dependency
$ npm install gulp --save-dev
# Check the versions installed. Make sure your versions are not lower than shown.
$ gulp -v
---
[10:48:35] CLI version 2.0.1
[10:48:35] Local version 4.0.0
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 try to install gatsby running npm install gatsby-cli -g , it shows that is successfuly installed but it does not work when I run gatsby --help oder gatsby -- build .... , it shows:
-bash: gatsby: command not found
the reason you are getting that is that you haven't installed it globally
$ npm i -g gatsby
$ source ~/.bashrc
source will refresh your terminal so you don't need to close it and open it up again
cli commands only work with globally installed packages
The Gatsby CLI is available via npm and should be installed globally by running:
npm install -g gatsby-cli
If you are unable to successfully run the Gatsby CLI due to a permissions issue, you may want to check out the npm docs on fixing permissions.
global flag -g comes first while installing any package
instead of npm install gatsby-cli -g run npm i -g gatsby-cli
any of below will work
npm install --global <package_name_to_install>
npm install -g <package_name_to_install>
npm i --global <package_name_to_install>
npm i -g <package_name_to_install>
for you package_name_to_install is gatsby-cli
When I use npm init in cmd, npm creates an etc directory and package.json.
Then when I use npm install stylus --save-dev,the module is downloaded in node_modules directory. But I can not find dependency in package.json
and I realize I can use command ls, mkdir in cmd, which is also confusing.
after npm init I cat package.json
This is my initial directory after I use npm init, I get etc\ directory, which should not be in this directory
This is the directory after I use npm install stylus --save-dev
After installing stylus, I cat package.json, but no dependency in this file
I cannot find out what is wrong.
I'm using Windows 10
node-version 8.9.1
npm version 5.5.1
npx installed
You could try:
npm install -D stylus
or
npm install stylus -D
For multiple packages, do this:
npm install pkg1 pkg2 pkg3 -S
or
npm install -S pkg1 pkg2 pkg3
The difference between -S and -D is -S adds the package(s) to dependencies while -D adds to dev-dependencies.
-S and -D are flags, regardless of where you put it, be it before the package names or after the package names, npm will recognise them and act accordingly.
Check out this command
npm install --save-dev stylus
When you write stylus then --save-dev it is identifying --save-dev as package not as command.
For multiple package to install we write
npm install package1 package2 package3
I was also having the same problem. I assume that you would have set "prefix" key for npm local configuration. Running:
npm config delete prefix
may help. Then start your project:
npm init or npm init -y
I'm getting the following warning when using 'create-react-app': npm WARN prefer global marked#0.3.6 should be installed with -g
How can I get rid of this warning?
I looked at "Question that may already have your answer" and didn't seem to find a precise answer. However, I'm new and may have overlooked the obvious.
My installs are:
$ npm -v
4.3.0
$ node --version
v7.0.0
$ npm list -g create-react-app
/usr/local/lib
└── create-react-app#1.2.1
$ npm list -g marked#
/usr/local/lib
└── marked#0.3.6
It looks to me that this package is already installed globally.
I ran the following:
$ sudo npm update -g create-react-app
which resulted in the following:
$ npm list -g create-react-app
/usr/local/lib
└── create-react-app#1.3.0
However, I still get:
npm WARN prefer global marked#0.3.6 should be installed with -g
Because that package includes the CLI.
Try to remove and install create-react-app to the newest version 1.3.0
npm install -g create-react-app
I need install gulp. I used this command: npm install gulp gulp-plumber gulp-sass gulp-autoprefixer gulp-concat gulp-uglify gulp-notify
Unfortunelly in my project It was created node_modules directory. How do I do this? I don't have to add files in any project. I would like to use only command "gulp watch".
add -g for global installing
$ npm install -g gulp
OR
$ sudo npm install -g gulp
To install a npm package globally on a machine, use one of
npm i -g <packages>
npm install --global <packages>
However, this doesn't let anybody else know about this dependency. Consider instead adding node_modules/ to your .gitignore file (or the ignore of whatever VCS you are using), then install with
npm i --save-dev <packages>
The --save-dev here means that it knows that this dependency is only for development and not required in deployment. So if you use a script to deploy which installs the npm dependencies, you can have it ignore these packages
Add gulp in your package.json and run npm intall from your project directory.