我是NodeJS的新手,我试着从express和express-generator开始。我已经安装了快车使用以下命令:'npm start'with Express-Generator(NodeJS)
C:\project>npm install -g express
然后我安装了快车发生器模块:
C:\project>npm install -g express-generator
然后我创建一个文件夹的项目和安装德的依赖关系:
C:\project\express> nodetest1
C:\project\nodetest1>npm install
一切工作正常,但当我尝试启动服务器时出现问题,使用命令:
C:\project\nodetest1>npm start
看来,服务启动,但因为它即开始关闭,结果是:
> [email protected] start C:\project\nodetest1
> node ./bin/www
C:\project\nodetest1>
当我尝试打开本地主机:3000这是行不通的。我在网上搜索,我还没有找到解决方案,有人可以指导我如何解决这个问题?
谢谢。
更新1:
有重新安装的node.js并遵循以下建议的步骤后,现在我得到一个错误:
C:\wamp\www\mynewapp>npm start
> [email protected] start C:\wamp\www\mynewapp
> node ./bin/www
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the mynewapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls mynewapp
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\wamp\www\mynewapp
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status -1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the mynewapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls mynewapp
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\wamp\www\mynewapp
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\wamp\www\mynewapp\npm-debug.log
npm ERR! not ok code 0
C:\wamp\www\mynewapp>
你有没有经历过“Thinkster.io”角度教程? – Goodword 2015-02-26 16:11:04
作为一个巧合,我昨天发现该网站,这个问题没有链接到该网站的任何教程。格式化PC后,我解决了这个问题,我从来不知道为什么会这样。 – Naschtok 2015-02-27 16:54:56