无法使用Express-generator进行“ npm start”

时间:2018-10-24 15:01:26

标签: node.js express npm npm-start

我所做的是安装express-generator并创建了项目。根据要求,我进入了项目Directoy,是否安装了npm并设置了SET DEBUG = project:*,但是之后我无法启动npm。

这是完整的日志:

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 npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle projectrl@0.0.0~prestart: projectrl@0.0.0
6 info lifecycle projectrl@0.0.0~start: projectrl@0.0.0
7 verbose lifecycle projectrl@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle projectrl@0.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;c:\Users\Rihards\Desktop\projectRL\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Java\jre1.8.0_101\bin\javaw.exe;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\wamp64\bin\php\php7.1.9;C:\composer;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Users\Rihards\AppData\Roaming\Composer\vendor\bin;C:\Users\Rihards\AppData\Roaming\npm
9 verbose lifecycle projectrl@0.0.0~start: CWD: c:\Users\Rihards\Desktop\projectRL
10 silly lifecycle projectrl@0.0.0~start: Args: [ '/d /s /c', 'node ./bin/www' ]
11 info lifecycle projectrl@0.0.0~start: Failed to exec start script
12 silly lifecycle projectrl@0.0.0~start: Returned: code: -4058  signal: null
13 info lifecycle projectrl@0.0.0~start: Failed to exec start script
14 verbose stack Error: projectrl@0.0.0 start: `node ./bin/www`
14 verbose stack spawn C:\Windows\system32\ ENOENT
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
14 verbose stack     at onErrorNT (internal/child_process.js:362:16)
14 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:139:11)
14 verbose stack     at process._tickCallback (internal/process/next_tick.js:181:9)
15 verbose pkgid projectrl@0.0.0
16 verbose cwd c:\Users\Rihards\Desktop\projectRL
17 verbose Windows_NT 6.3.9600
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 verbose node v8.12.0
20 verbose npm  v6.4.1
21 error file C:\Windows\system32\
22 error path C:\Windows\system32\
23 error code ELIFECYCLE
24 error errno ENOENT
25 error syscall spawn C:\Windows\system32\
26 error projectrl@0.0.0 start: `node ./bin/www`
26 error spawn C:\Windows\system32\ ENOENT
27 error Failed at the projectrl@0.0.0 start script.
27 error This is probably not a problem with npm. There is likely additional logging output above.
28 verbose exit [ 1, true ]

我希望有人能帮我解决这个问题!

1 个答案:

答案 0 :(得分:0)

这可能与Windows系统权限异常,运行的防病毒程序或类似内容有关。

具体的问题是,Yarn和npm似乎都无法生成进程。

您可以尝试重新安装Node,禁用任何防病毒软件,以系统管理员身份登录