简体   繁体   中英

Getting error while installing express-generator on ubuntu

I am getting error while installing express-generator

sudo npm install -g express-generator
npm http GET https://registry.npmjs.org/express-generator
npm http 304 https://registry.npmjs.org/express-generator
npm http GET https://registry.npmjs.org/commander/2.7.1
npm http GET https://registry.npmjs.org/mkdirp/0.5.1
npm http GET https://registry.npmjs.org/sorted-object/1.0.0
npm http 304 https://registry.npmjs.org/commander/2.7.1
npm http 304 https://registry.npmjs.org/mkdirp/0.5.1
npm http 304 https://registry.npmjs.org/sorted-object/1.0.0
npm http GET https://registry.npmjs.org/graceful-readlink
npm http GET https://registry.npmjs.org/minimist/0.0.8
npm http 304 https://registry.npmjs.org/graceful-readlink
npm http 304 https://registry.npmjs.org/minimist/0.0.8
/usr/local/bin/express -> /usr/local/lib/node_modules/express-generator/bin/express
express-generator@4.13.1 /usr/local/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)

I think this is why I can not use express command on terminal.

it is giving me below error while running command

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

I am using ubuntu 14.04.

can anyone shade light on this? why i am getting 304?

You need to install express. Try:

npm install -g express
/usr/local/bin/express -> /usr/local/lib/node_modules/express-generator/bin/express


bash: /usr/bin/express: No such file or directory

These two lines are not matching obviously. So, as a quick solution, you can try to link them manually by ln :

[sudo] ln -s /usr/local/lib/node_modules/express-generator/bin/express /usr/bin/express


The other question, "can anyone shade light on this? why i am getting 304?"

304 means "resource has not been modified since last requested", so nothing to worry about it. Since you installed it before and it hasn't change until your next install, you're getting this http status code.

304 status code:

If the client has done a conditional GET and access is allowed, but the document has not been modified since the date and time specified in If-Modified-Since field, the server responds with a 304 status code and does not send the document body to the client.

So as you can see, it is not an error.

You can find more details about status codes at http://www.w3.org/Protocols/HTTP/HTRESP.html

Note: Not only this module, but almost all modules will show 304 status code when installing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM