在Windows 7上启动Node应用程序中的问题

问题描述:

我使用的是Windows 7,并且我安装了node.js并进行了表达。 我用下面在Windows 7上启动Node应用程序中的问题

> express projectName 

一个新项目创建后,使用命令快递安装依赖关系创建项目后,我做

> npm install 

所有作品好为止。但是当我尝试启动应用程序时

> npm start  

以下是我在npm-debug.log文件中遇到的问题。请在这里建议最新的错误。 我已经尝试了许多其他线程,但解决方案发现那里为我工作。

0 info it worked if it ends with ok 
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe', 
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 
1 verbose cli 'start' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose node symlink C:\Program Files\nodejs\\node.exe 
5 verbose run-script [ 'prestart', 'start', 'poststart' ] 
6 info prestart [email protected] 
7 info start [email protected] 
8 verbose unsafe-perm in lifecycle true 
9 info [email protected] Failed to exec start script 
10 error [email protected] start: `node ./bin/www` 
10 error spawn ENOENT 
11 error Failed at the [email protected] start script. 
11 error This is most likely a problem with the NodeTestApp package, 
11 error not with npm itself. 
11 error Tell the author that this fails on your system: 
11 error  node ./bin/www 
11 error You can get their info via: 
11 error  npm owner ls NodeTestApp 
11 error There is likely additional logging output above. 
12 error System Windows_NT 6.1.7601 
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
14 error cwd C:\Users\Ali\Desktop\NodeTestApp 
15 error node -v v0.10.33 
16 error npm -v 1.4.28 
17 error syscall spawn 
18 error code ELIFECYCLE 
19 error errno ENOENT 
20 verbose exit [ 1, true ] 
+0

一个快速生成的应用程序应该调用'./bin/www'而不是'app.js'。你在'package.json'中改变了这个吗?如果觉得你可能会忽略信息或跳过你采取的步骤。 – 2014-12-05 21:42:52

+0

@MatthewBakaitis是它的./bin/www。我将它更改为app.js,因为我正在学习一个教程。最初它是./bin/www和我更新了上面的结果,当我> npm开始时。它几乎看起来相同。 – farhangdon 2014-12-06 03:11:08

child_process.spawn()返回ENOENT当它不能找到请求的执行;在这种情况下,node.exe。仔细查看日志,我们可以看到npm start正试图运行node app.js

节点在您的PATH?如果您只是在命令行中键入node app.js,会发生什么情况?

+0

当我只键入节点app.js时,它什么也不做,并且控制权再次返回到相同的地方。结果下 C:\用户\阿里\桌面\ airline2>节点app.js
C:\用户\阿里\桌面\ airline2> – farhangdon 2014-12-05 20:50:41

+0

和node.js的是在我的PATH变量 – farhangdon 2014-12-05 20:53:42

尝试在Windows 7 this.It的工作对我的32位的Node.js

您project.Go创建新的空白文件夹到您的项目文件夹,然后手工创建NPM文件夹(不使用命令行)。

然后再次尝试创建新项目。

希望得到这个帮助。