admin管理员组文章数量:1401937
so I did npm install express according to the tutorial, after installing express I did
'express --version'
and express is not in my path. I am wondering what I did wrong or is there any way to test if express works on my OS.
so I did npm install express according to the tutorial, after installing express I did
'express --version'
and express is not in my path. I am wondering what I did wrong or is there any way to test if express works on my OS.
Share Improve this question edited Apr 16, 2011 at 11:28 MPelletier 16.7k18 gold badges89 silver badges140 bronze badges asked Apr 7, 2011 at 16:31 ericraioericraio 1,46914 silver badges35 bronze badges 1- install express via npm? – Alfred Commented Apr 7, 2011 at 22:22
3 Answers
Reset to default 9Did you use npm install express
or npm install express -g
?
The second mand is what you should use if you want to use the express program from the mand line. The -g
option installs the library globally.
The first mand will just install the library in a node_modules
subfolder, and you would need to explicitly locate the program before using it, eg. node ./node_modules/express/bin/express
(I'm not sure if that's the right mand, just an example).
Did you try adding the path to the npm's bin directory to your PATH?
export PATH="/usr/local/share/npm/bin:$PATH"
Create a directory and execute: $ npm install -g express
If you want to generate an application with EJS, Stylus etc simply execute:
$ express --sessions --css stylus --ejs yourapp
本文标签: javascriptExpressJS InstallationStack Overflow
版权声明:本文标题:javascript - ExpressJS Installation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744263525a2597833.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论