使用npm run start后的npm elifecycle err

时间:2020-10-15 09:19:49

标签: node.js npm

在将应用程序部署到Heroku之后,我在本地计算机上更改了一些代码。 在尝试执行npm run启动脚本后,我第一次得到了此ERR。 在日志中,您可以看到ERR不是来自某些特定的软件包。 我试图删除node_modules文件夹和package-JSON.lock(手动)并运行:

npm cache clean --force

手动删除node_modules和package-JSON.lock的文件夹 我没有设法使用rm -rf node_modules package-lock.json

npm install

在npm安装中,出现一个错误,因此我使用了npm install --force

我尝试过的

解决方案: How to solve npm error "npm ERR! code ELIFECYCLE" What does the ELIFECYCLE Node.js error mean?

我的日志文件:

0 info it worked if it ends with ok
1 verbose cli [
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   'run',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.14.6
3 info using node@v12.18.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle natours@1.0.0~prestart: natours@1.0.0
6 info lifecycle natours@1.0.0~start: natours@1.0.0
7 verbose lifecycle natours@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle natours@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Projects\natours-project\node_modules\.bin;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Users\Asus\AppData\Local\Microsoft\WindowsApps;;C:\Users\Asus\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Asus\AppData\Roaming\npm;C:\Program Files\heroku\bin
9 verbose lifecycle natours@1.0.0~start: CWD: C:\Projects\natours-project
10 silly lifecycle natours@1.0.0~start: Args: [ '/d /s /c', 'node server.js' ]
11 silly lifecycle natours@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle natours@1.0.0~start: Failed to exec start script
13 verbose stack Error: natours@1.0.0 start: `node server.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid natours@1.0.0
15 verbose cwd C:\Projects\natours-project
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.18.3
19 verbose npm  v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error natours@1.0.0 start: `node server.js`
22 error Exit status 1
23 error Failed at the natours@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我在GitHub上的代码:https://github.com/adids1221/natours-project

0 个答案:

没有答案