我正在学习 node.js,我正在尝试使用命令 node app.js
运行 app.js 文件,但 bash 什么也不返回(也没有错误)。以下是我遵循的步骤:
$ brew install node
$ sudo npm install -g express
$ sudo npm install -g express-generator
进入我创建的新文件夹后,我运行
$ express testsite --hogan -c less
$ cd testsite && npm install
终于
$ node app.js
//不返回任何错误,但除了新的命令行之外什么也不返回...
在这方面的任何帮助都会很棒。
谢谢!
最佳答案
从 testsite 目录尝试 npm start
。
查看 package.json
scripts : { start : node bin/www }
所以你必须执行bin目录下的www。
所以 node app.js
使用 node bin/www
关于javascript - 无法运行 Node app.js 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23178363/