0

I am trying to install express-generator on my ubuntu 14.04 by running this command

sudo npm install express-generator -g

it shows that express-generator is installed

sinscary@avenger:~$ sudo npm install express-generator -g
[sudo] password for sinscary: 
/home/sinscary/.node/bin/express -> /home/sinscary/.node/lib/node_modules/express-generator/bin/express
express-generator@4.13.4 /home/sinscary/.node/lib/node_modules/express-generator
├── sorted-object@2.0.0
├── commander@2.7.1 (graceful-readlink@1.0.1)
└── mkdirp@0.5.1 (minimist@0.0.8)

but i don't know why when i run express -h i am continuously getting this error

The program 'express' is currently not installed. You can install it by typing:
sudo apt-get install node-express

I am able to install express with sudo apt-get install node-express this command but i read somewhere that the prefered way of installing express-generator is with npm.

This Question is similar to my problem but solution given here didn't work for me. As i can see by comparing the answer given here, in my case npm is placing the binary links in /home/username/.node/bin instead of /home/username/npm/bin

So i added export PATH=$HOME/.node/bin:$PATH to my .bashrc file but still getting the same error.

I have followed step by step to install express as suggested in Documentation , but still facing the same problem.

Any help on that

Community
  • 1
  • 1
Sinscary
  • 652
  • 12
  • 32
  • Does it run if you invoke it with the full path: `~/.node/bin/express` ? – Trott Jul 31 '16 at 04:26
  • yes it does, but when i run only `express` i am facing same problem. – Sinscary Jul 31 '16 at 04:46
  • 1
    The .bashrc change should have really fixed it for you then. Odd. If you haven't already checked, I'd make sure that the .bashrc file is really running (do an `echo $PATH` to make sure the `PATH` change has taken effect). Maybe `PATH` gets overwritten again later in that or some other dotfile? – Trott Jul 31 '16 at 04:53
  • Hey thanks for reply, i don't know why but when i restarted my laptop and ran `express` it worked, I don't know why but restarting the laptop does the job. – Sinscary Jul 31 '16 at 05:02
  • 2
    You made a change to your `.bashrc`, but that doesn't change your current operating environment. You have to tell `bash` to "reload" the file. you can do that with `source ~/.bashrc` or `. ~/.bashrc` (`.` and `source` are aliases to each other) or you can start a new terminal session, which will load the new file OR you can restart your computer, which will, of course, load the new version of that file. Good luck. – shellter Jul 31 '16 at 12:35

0 Answers0