1

I started a Digital Ocean droplet from the node.js image ( w ubuntu 14.04) checking it, I get :

$ node -v
  v4.3.0

Then , I tried to install the latest version of express.js :

    $ sudo npm install -g express
    express@4.13.4 /usr/lib/node_modules/express
    ├── escape-html@1.0.3
    ├── array-flatten@1.1.1
    ├── cookie-signature@1.0.6
    ├── utils-merge@1.0.0
    ├── content-type@1.0.1
    ├── merge-descriptors@1.0.1
    ├── vary@1.0.1
    ├── methods@1.1.2
    ├── fresh@0.3.0
    ├── etag@1.7.0
    ├── parseurl@1.3.1
    ├── path-to-regexp@0.1.7
    ├── cookie@0.1.5
    ├── content-disposition@0.5.1
    ├── range-parser@1.0.3
    ├── serve-static@1.10.2
    ├── depd@1.1.0
    ├── qs@4.0.0
    ├── on-finished@2.3.0 (ee-first@1.1.1)
    ├── finalhandler@0.4.1 (unpipe@1.0.0)
    ├── debug@2.2.0 (ms@0.7.1)
    ├── proxy-addr@1.0.10 (forwarded@0.1.0, ipaddr.js@1.0.5)
    ├── send@0.13.1 (destroy@1.0.4, statuses@1.2.1, ms@0.7.1, mime@1.3.4, http-errors@1.3.1)
    ├── type-is@1.6.11 (media-typer@0.3.0, mime-types@2.1.10)
    └── accepts@1.2.13 (negotiator@0.5.3, mime-types@2.1.10)

but when I check express version , I get an error :

  $ express -v
 -bash: /usr/bin/express: No such file or directory

what could be wrong ? thanks for feedback

UPDATE ---

I uninstalled& reinstalled node.js :

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodes
$ node -v
v4.3.1

but same issue

sudo npm install -g express express@4.13.4 /usr/lib/node_modules/express ... $ express -v -bash: /usr/bin/express: No such file or directory

  • I don't think express has a CLI does it? – Roland Starke Feb 26 '16 at 17:09
  • Nope, express isn't a CLI application. You require it in your code with `var express = require('express')` – Sven Feb 26 '16 at 17:10
  • thanks .. your comments put me on the road ... http://stackoverflow.com/questions/23002448/express-command-not-found I need to install express-generator to get the cli ... express-generator@4.13.1 /usr/lib/node_modules/express-generator ├── sorted-object@1.0.0 ├── commander@2.7.1 (graceful-readlink@1.0.1) └── mkdirp@0.5.1 (minimist@0.0.8) –  Feb 26 '16 at 17:46

1 Answers1

1

Check that /usr/lib/node_modules/express is present in your PATH variable.

echo $PATH will print current PATH

Also, maybe you dint install express-generator?

loadaverage
  • 1,028
  • 1
  • 11
  • 16