我是React的新手。我已经创建了一些应用程序作为应用程序,但是尝试在Github上上传应用程序时仍然遇到麻烦。运行时的主要问题
npm run build or npm run deploy
我总是收到以下消息:
npm错误!代码ELIFECYCLE
npm ERR! errno 1
npm ERR! random-qoute-generator@0.1.0构建:react-scripts build
npm ERR!退出状态1
npm ERR!
npm ERR!在random-qoute-generator@0.1.0构建脚本上失败。
npm ERR! npm可能不是问题。上面可能还有其他日志记录输出。
npm错误!可以在以下位置找到此运行的完整日志:
npm ERR! C:\ Users \ Dev-Ahmed-Elbessfy \ AppData \ Roaming \ npm-cache_logs \ 2019-02-07T16_26_38_090Z-de bug.log
npm ERR!代码ELIFECYCLE
npm ERR! errno 1
npm ERR! random-qoute-generator@0.1.0预部署:npm run build
npm ERR!退出状态1
npm ERR!
npm ERR!在random-qoute-generator@0.1.0预部署脚本处失败。
npm ERR! npm可能不是问题。上面可能还有其他日志记录输出。
npm错误!可以在以下位置找到此运行的完整日志: npm ERR! C:\ Users \ Dev-Ahmed-Elbessfy \ AppData \ Roaming \ npm-cache_logs \ 2019-02-07T16_26_38_137Z-debug.log
有人可以帮忙吗? 我也已经在Github仓库上上传了所有项目文件: https://github.com/Ahmed-Elbessfy/random-quote-generator
更新:
文件提及的内容
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 npm@5.6.0
3 info using node@v8.11.1
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle random-qoute-generator@0.1.0~predeploy: random-qoute-generator@0.1.0
6 verbose lifecycle random-qoute-generator@0.1.0~predeploy: unsafe-perm in lifecycle true
7 verbose lifecycle random-qoute-generator@0.1.0~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 random-qoute-generator@0.1.0~predeploy: CWD: E:\Web Design\React\applications\random-qoute-generator
9 silly lifecycle random-qoute-generator@0.1.0~predeploy: Args: [ '/d /s /c', 'npm run build' ]
10 silly lifecycle random-qoute-generator@0.1.0~predeploy: Returned: code: 1 signal: null
11 info lifecycle random-qoute-generator@0.1.0~predeploy: Failed to exec predeploy script
12 verbose stack Error: random-qoute-generator@0.1.0 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 random-qoute-generator@0.1.0
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 random-qoute-generator@0.1.0 predeploy: `npm run build`
21 error Exit status 1
22 error Failed at the random-qoute-generator@0.1.0 predeploy script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]
答案 0 :(得分:0)
如果添加依赖项“ terser”,它将起作用
npm install terser
答案 1 :(得分:0)
那是因为端口构建正在运行..所以终止进程然后重试