0
votes

I am new to React. I have created some apps as an application but I still have trouble when I try to upload my app on Github. The main issue when running

npm run build or npm run deploy

I always have this messages :

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build: react-scripts build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Dev-Ahmed-Elbessfy\AppData\Roaming\npm-cache_logs\2019-02-07T16_26_38_090Z-de bug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] predeploy: npm run build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] predeploy script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Dev-Ahmed-Elbessfy\AppData\Roaming\npm-cache_logs\2019-02-07T16_26_38_137Z-debug.log

Can anyone help please? I also have uploaded all the project file on Github repo here : https://github.com/Ahmed-Elbessfy/random-quote-generator

UPDATE:
file mentioned content

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   'run',
1 verbose cli   'deploy' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle [email protected]~predeploy: [email protected]
6 verbose lifecycle [email protected]~predeploy: unsafe-perm in lifecycle true
7 verbose lifecycle [email protected]~predeploy: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\Web Design\React\applications\random-qoute-generator\node_modules\.bin;C:\Users\Dev-Ahmed-Elbessfy\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Dev-Ahmed-Elbessfy\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;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:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\nodejs;C:\Program Files\Microsoft VS Code\bin;C:\Users\Dev-Ahmed-Elbessfy\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
8 verbose lifecycle [email protected]~predeploy: CWD: E:\Web Design\React\applications\random-qoute-generator
9 silly lifecycle [email protected]~predeploy: Args: [ '/d /s /c', 'npm run build' ]
10 silly lifecycle [email protected]~predeploy: Returned: code: 1  signal: null
11 info lifecycle [email protected]~predeploy: Failed to exec predeploy script
12 verbose stack Error: [email protected] predeploy: `npm run build`
12 verbose stack Exit status 1
12 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
12 verbose stack     at emitTwo (events.js:126:13)
12 verbose stack     at EventEmitter.emit (events.js:214:7)
12 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
12 verbose stack     at emitTwo (events.js:126:13)
12 verbose stack     at ChildProcess.emit (events.js:214:7)
12 verbose stack     at maybeClose (internal/child_process.js:925:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
13 verbose pkgid [email protected]
14 verbose cwd E:\Web Design\React\applications\random-qoute-generator
15 verbose Windows_NT 6.2.9200
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy"
17 verbose node v8.11.1
18 verbose npm  v5.6.0
19 error code ELIFECYCLE
20 error errno 1
21 error [email protected] predeploy: `npm run build`
21 error Exit status 1
22 error Failed at the [email protected] predeploy script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]
2
As the error says there is a more detailed log of what went wrong in 2019-02-07T16_26_38_137Z-debug.log - Dominic
And how to solve it? - Ahmed Elbessfy
Does it work locally with npm start? - ChrKahl
You need to post up the detailed error log you didn’t provide anything other than a generic error as far as I can see - Dominic
CharKahl Yes it works normally - Ahmed Elbessfy

2 Answers

0
votes

It will work if you add the dependency "terser"

npm install terser
0
votes

That was because port build is running.. so terminate process then try again