I'm new in node js, I'm triying to install globally express
npm i -g express
all completes, but when I enter
express --help
it says that it's not inside or outside command, however when i enter supervisor it runs OK. I looked into pathof express and there is no any .cmd file. If the problem is that. How should i fix it?
Please help.
Installing npm install -g express will install express 4.
Express 4 separates the generator from express.
What you need to do is to run:
$ npm install -g express-generator
Then it will work.
As stated in express Readme [1], you need to install express generator separately, using following command:
npm install -g express-generator#3
[1] - https://github.com/visionmedia/express/blob/master/Readme.md
Related
This is quite basic. Many examples show terminal commands such as: 'express name-of-directory-to-be-created'. Yet on my system, though I've installed node.js (and command: node -v works, and npm -v works), command: express fails with: command not found Further investigation shows that, on my macbook air, all incidences of express.js are not executable. I believe express was installed using npm express or npm -g express. Please, what is going on? Are the examples correct? ( There are several, all from various sources. ) How may I execute
express directory
Thanks in advance.
This usually happens on windows.
You need to install express globally and the location where npm modules get installed should be added to PATH(environment variable).
To install express globally type npm install -g express
Also it looks like you are trying to use express-generator.If yes you should install it similarly.
npm install -g express-generator
In windows by default npm modules are installed at "C:\Users\u_name\AppData\Roaming\npm"
Edit your PATH environment variable and append your npm path at the end.
I am trying to install express module install, but the issue is that after installation I am still unable to use express.
What I've done:
Install express using cmd - npm install -g express
For some reason it's not installing globally.
Help?
You might want to use the following:
npm install -g express-generator
Source: Issues with installing Express.JS in Windows 7
In later versions of express comand line was migrated to a separate module: express-generetor
use
npm install -g express-generator#3
and could use the express command
For example I installed express with global (-g) parameter. In node.js/node_modules folder express doesn't exists.
I tried to install it without global parameter and it works perfectly.
How to install it globally?
Thanks.
Installing modules via npm with -g is only for modules that provide command-line utilities, not for making any ordinary module accessible from anywhere.
So if you are looking to use the command-line express project generator utility/command, you need to use npm install -g express-generator instead.
If you want to require('express'); in your application, then you need to install express with npm install express.
I'm having trounble with installing express. After I do npm install express, express is still not visible. I.e. I'm unable to do express appname. I'm running Win7. What is done incorrectly?
UPD. I'm following this tutorial
since express 4.0 the CLI tools are not part of the main express package anymore. if you want to have the generator you have to install it separately:
npm install -g express-generator
see here
If you want to run the :
express appname
command, you should install express the following way :
sudo npm install -g express
or just:
npm install -g express
if you are not on a UNIX system. Otherwise if you already did an :
npm install express
you can run this command:
./node_modules/express/bin/express appname
from your project's root directory.
I recently installed nodejs version 0.10.26 on ubuntu 64 bit. node -v and npm -v commands run fine and I can see the correct versions. When I do a $ sudo npm install -g express
the installation goes fine. But when I try to create a project with express as $ express myProject I get an error saying
The program 'express' is currently not installed. You can install it
by typing: sudo apt-get install node-express
Do I have to include some path in $PATH in order to run express? Please help.
With Express 4, the application generator was removed and is now available as 'express-generator.' So you need to npm install -g express-generator instead.
Enter the command in your terminal
npm install --save express