'Express'不能被识别命令(windows) [英] 'Express' is not recognized command (windows)
问题描述
D:\
-myproject
-node_modules
-.bin
-express
然而,当我在这个'myproject '目录,我似乎不能运行'express',例如:
D:\myproject\express site
'express'不被识别为内部或外部命令,可操作的程序或批处理文件。
我做错了什么?
我的猜测是您没有在全球安装Express。您可以使用以下命令在全局安装express(并因此可用于您的PATH)(请参阅 http://expressjs.com/guide.html):
npm install -g express
安装它的方式仅在您安装它的文件夹中可用,并且该方法没有任何问题。
如果express不在您的PATH中,可以通过输入完整路径来运行:
\myproject\\\
ode_modules\.bin\express.cmd
Okay I am running node on windows (7). Using npm I just installed modules to d:\ directory. Therefore my files structure looks like the following:
D:\
-myproject
-node_modules
-.bin
-express
However, when I am in this 'myproject' directory, I can't seem to run 'express' for example:
D:\myproject\express site
'express' is not recognized as an internal or external command, operable program or batch file.
Am I doing anything wrong?
My guess is that you didn't install Express globally. You can install express globally (and therefore available in your PATH) with the following command (see http://expressjs.com/guide.html) :
npm install -g express
The way you install it is available only in the folder that you installed it and there is nothing wrong with that approach. There is very little advantage of having it available globally.
If express is not in your PATH you can run it by entering the full path to it:
\myproject\node_modules\.bin\express.cmd
这篇关于'Express'不能被识别命令(windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!