无法运行节点app.js文件 [英] Unable to run node app.js file

查看:485
本文介绍了无法运行节点app.js文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习node.js,我正在尝试使用命令 node app.js 运行app.js文件但是bash什么都不返回(也没有错误) 。以下是我遵循的步骤:

I am learning node.js and I am trying to run the app.js file using the command node app.js but the bash returns nothing (no errors either). Here are the steps I followed:

$ brew install node

$ sudo npm install -g express

$ sudo npm install - g express-generator

进入我创建的新文件夹后运行

after i get into a new folder I created I run

$ express testsite --hogan -c less

$ cd testsite& &安培; npm install

最后

$ node app。 js //除了新的命令行之外没有任何错误但没有回复...

$ node app.js // returns no errors but nothing back except new command line...

任何有关这方面的帮助都会很棒。

Any help on this would be great.

谢谢!

推荐答案

尝试 npm start 来自 testsite 目录。

查看 package.json

scripts : { start : node bin/www }

因此,您必须执行 bin 目录下的 www

So you must execute the www under the bin directory.

因此,而不是 node app.js 使用节点bin / www

这篇关于无法运行节点app.js文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆