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