简体   繁体   English

为什么我不能运行我的node.js表达web应用程序

[英]Why can't I run my node.js express web application

Node.js and the express generator are really handy and simple to understand. Node.js和express生成器非常方便易懂。 I cannot however get my server to start by running c:\\my-application-root>DEBUG=my-application ./bin/www 但是我不能通过运行c:\\ my-application-root> DEBUG = my-application ./bin/www来启动我的服务器。

Windows doesn't seem to understand that command. Windows似乎不理解该命令。 I can however run it by calling node ./bin/www 然而,我可以通过调用节点./bin/www来运行它

Am i missing something? 我错过了什么吗?

Did you try set DEBUG=my-application followed by node ./bin/www ? 您是否尝试过set DEBUG=my-application后跟node ./bin/www Windows does not allow setting an environment variable in the way that Linux and others do. Windows不允许以Linux和其他方式设置环境变量。

第一个命令'set DEBUG = my-application'2nd command'npm start'

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如果设置为环境变量也将帮助您运行节点,因为路径将是已知的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我不需要在node.js中表达 - Why can't I require express in node.js Node.js快递:为什么我看不到cookies? - Node.js express: why can't I read cookies ? 为什么我不能向我的 Node.js Express 服务器发出 POST 请求 - Why can't I make a POST request to my Node.js Express server 我可以在 Node.js 和 Express 中运行 single.js 文件吗? - Can I run a single .js file in Node.js and Express? Node.js无法识别Express对象,并且无法设置CSS / JS的路径 - Node.js won't recognise an Express object & I can't set paths to my CSS/JS 我刚刚在运行Ubuntu的新服务器上运行了新的node.js / express应用,如何查看我的Web应用? - I have just run my new node.js/express app on a new server which runs Ubuntu, how can i see my web app? 为什么我每次运行node.js应用程序时代码打印不合逻辑的模式? - Why is my code printing illogical patterns everytime I run my node.js application? 为什么我不能用Node.js express设置cookies? - Why I couldn't set cookies with Node.js express? 为什么在部署到AWS时无法在node.js中表达sendFile()? - why I can't sendFile() in node.js express when deployed to AWS? 我可以在同一个文件结构中同时运行我的 Node.js/Express 后端和 React.js 前端吗? - Can I run my Node.js/Express backend and React.js frontend together in the same file structure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM