shinjin
shinjin

Reputation: 364

NodeJS Express installation in zsh not found.....symlink issue?

I am attempting to install Express using the npm package manager. It seems to successfully install, but then when I try to run "express xxxxx" it always says the command is not found.

Here is the output of my install

$ sudo npm install -g express
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express/4.0.0
........
npm http 304 https://registry.npmjs.org/fresh/0.2.0
[email protected] /usr/local/lib/node_modules/express
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected])

Running "which express" leads to an express not found.

Interestingly enough, if I try to install an older version of express using:

sudo npm install -g [email protected]

everything works fine.

The only difference is this line, which isn't present in the output above:

   /usr/local/bin/express -> /usr/local/lib/node_modules/express/bin/express

It looks like it is symlinking something, but I am a bit of a novice at UNIX so I don't really know how to fix this issue.

Additional Notes: I installed node and npm from the package on the official nodejs website. I am running a Mavericks OS.

I have searched throughout the forums, and none of the solutions I have found, e.g. updating the path, appending the "-g" flag, or other solutions have worked for me.

Upvotes: 0

Views: 396

Answers (1)

Andreas Hultgren
Andreas Hultgren

Reputation: 14953

Using express as a global executable seems to be deprecated. Use npm install -g express-generator@3 instead, according to the docs.

Upvotes: 1

Related Questions