1

I am trying to build my React app that built fine before I added TypeScript to the project. The debug log looks like this:

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   'build'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v14.3.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle fyahpay_web_app@0.1.0~prebuild: fyahpay_web_app@0.1.0
6 info lifecycle fyahpay_web_app@0.1.0~build: fyahpay_web_app@0.1.0
7 verbose lifecycle fyahpay_web_app@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle fyahpay_web_app@0.1.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\nayja\Desktop\Web Projects\fyahPay\fyahpay_web_app\node_modules\.bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;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\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\MATLAB\R2017a\runtime\win64;C:\Program Files\MATLAB\R2017a\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\cl.exe;C:\Program Files\PuTTY\;C:\Program Files\LLVM\bin;C:\MinGW\bin;C:\Users\nayja\Desktop\OpenCV Projects\opencv\build\x64\vc14\bin;C:\Users\nayja\Desktop\Web Projects\emsdk\upstream\emscripten;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Users\nayja\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\Java\jdk-13\bin;C:\Users\nayja\Desktop\Web Projects\emsdk;C:\Users\nayja\Desktop\Web Projects\emsdk\upstream\emscripten;C:\Users\nayja\Desktop\Web Projects\emsdk\node\12.9.1_64bit\bin;C:\Users\nayja\Desktop\Web Projects\emsdk\python\3.7.4-pywin32_64bit;C:\Users\nayja\Desktop\Web Projects\emsdk\java\8.152_64bit\bin;C:\Users\nayja\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\nayja\AppData\Local\Programs\Python\Python38-32\;E:\JDK\OpenJDK\openjdk-8u262-b10\bin;E:\Android\Sdk\platform-tools;C:\Python38;C:\Python38\Scripts;C:\Program Files\Wasmtime\bin;C:\Users\nayja\.wasmer\bin;C:\Users\nayja\.wasmer\globals\wapm_packages\.bin;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;C:\Users\nayja\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\nayja\AppData\Local\Programs\Python\Python38-32\;C:\Program Files (x86)\Elm\0.19.1\bin;C:\Users\nayja\AppData\Local\Microsoft\WindowsApps;C:\Users\nayja\AppData\Local\JetBrains\PyCharm 2018.3.1\bin;C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.2\bin;C:\Program Files\heroku\bin;C:\Users\nayja\AppData\Local\GitHubDesktop\bin;C:\Users\nayja\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\nayja\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\nayja\AppData\Roaming\npm;C:\Program Files\Java\jdk-13\bin;C:\Program Files\Wasmtime\bin;;C:\Users\nayja\.wasmer\bin
9 verbose lifecycle fyahpay_web_app@0.1.0~build: CWD: C:\Users\nayja\Desktop\Web Projects\fyahPay\fyahpay_web_app
10 silly lifecycle fyahpay_web_app@0.1.0~build: Args: [ '/d /s /c', 'react-scripts build' ]
11 silly lifecycle fyahpay_web_app@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle fyahpay_web_app@0.1.0~build: Failed to exec build script
13 verbose stack Error: fyahpay_web_app@0.1.0 build: `react-scripts build`
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:1051:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid fyahpay_web_app@0.1.0
15 verbose cwd C:\Users\nayja\Desktop\Web Projects\fyahPay\fyahpay_web_app
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" "build"
18 verbose node v14.3.0
19 verbose npm  v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error fyahpay_web_app@0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the fyahpay_web_app@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I tried deleting node_modules and package-lock.json and then running npm i but that didn't work. The problem still persists.

GalaxyCat105
  • 2,105
  • 4
  • 12
  • 26
  • Found this, which may help (you may need to clean your cache) https://stackoverflow.com/questions/42308879/how-to-solve-npm-error-npm-err-code-elifecycle – user2740650 Jan 01 '21 at 00:00
  • I tried everything in that post. Error still there :( –  Jan 01 '21 at 01:51
  • You mentioned adding TypeScript to your project. It's hard to guess what went wrong there, but you could try starting a branch new TS react project separately (https://create-react-app.dev/docs/getting-started, see `--template typescript`) and then copying your project's source files over top of it. – user2740650 Jan 01 '21 at 02:02
  • ok I'll try that. When I run npm start it also fails. But when I delete the tsconfig.json it works. That's weird. –  Jan 01 '21 at 02:19

0 Answers0