Node.js and the express generator are really handy and simple to understand. I cannot however get my server to start by running c:\my-application-root>DEBUG=my-application ./bin/www
Node.js和express生成器非常方便易懂。但是我不能通过运行c:\ my-application-root> DEBUG = my-application ./bin/www来启动我的服务器。
Windows doesn’t seem to understand that command. I can however run it by calling node ./bin/www
Windows似乎不理解该命令。然而,我可以通过调用节点./bin/www来运行它
Am i missing something?
我错过了什么吗?
3 个解决方案
#1
20
Did you try set DEBUG=my-application
followed by node ./bin/www
? Windows does not allow setting an environment variable in the way that Linux and others do.
您是否尝试过设置DEBUG = my-application,后跟节点./bin/www? Windows不允许以Linux和其他人的方式设置环境变量。
#2
5
1st command 'set DEBUG=my-application'.2nd command 'npm start'
第一个命令'set DEBUG = my-application'2nd command'npm start'
#3
2
First you need to go the cmd that is supported by node (search for node cmd when you click in windows icon if you're using windows 7) type set DEBUG=my-application Second simply cd c:\my-application\bin\ Then type node www
首先,您需要使用节点支持的cmd(如果您使用的是Windows 7,则在单击Windows图标时搜索节点cmd)类型设置DEBUG = my-application其次只需cd c:\ my-application \ bin \然后键入节点www
www is the file that contains the script needed by node to run your server, DEBUG if set as an environment variable will also help you run node against it since the path will be known
www是包含节点运行服务器所需脚本的文件,DEBUG如果设置为环境变量也将帮助您运行节点,因为路径将是已知的
#1
20
Did you try set DEBUG=my-application
followed by node ./bin/www
? Windows does not allow setting an environment variable in the way that Linux and others do.
您是否尝试过设置DEBUG = my-application,后跟节点./bin/www? Windows不允许以Linux和其他人的方式设置环境变量。
#2
5
1st command 'set DEBUG=my-application'.2nd command 'npm start'
第一个命令'set DEBUG = my-application'2nd command'npm start'
#3
2
First you need to go the cmd that is supported by node (search for node cmd when you click in windows icon if you're using windows 7) type set DEBUG=my-application Second simply cd c:\my-application\bin\ Then type node www
首先,您需要使用节点支持的cmd(如果您使用的是Windows 7,则在单击Windows图标时搜索节点cmd)类型设置DEBUG = my-application其次只需cd c:\ my-application \ bin \然后键入节点www
www is the file that contains the script needed by node to run your server, DEBUG if set as an environment variable will also help you run node against it since the path will be known
www是包含节点运行服务器所需脚本的文件,DEBUG如果设置为环境变量也将帮助您运行节点,因为路径将是已知的