【发布时间】:2020-11-11 15:12:15
【问题描述】:
我正在尝试以安全模式运行我的 react 应用程序,但是一旦我在 package.json 中将 HTTPS 设置为 true,我就会收到以下错误。该应用程序在不安全模式下运行良好。我也尝试过使用自定义 SSL 证书,但这也给出了同样的错误。我在 Windows 7 上运行该应用程序。
"start": "set HTTPS=true&&react-scripts start"
set HTTPS=true&&react-scripts start
Starting the development server...
internal/buffer.js:944
class FastBuffer extends Uint8Array {}
RangeError: Invalid typed array length: -4095 at new Uint8Array (<anonymous>)
←[90m at new FastBuffer (internal/buffer.js:944:1)←[39m
←[90m at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:185:19)←[39m
at Stream.<anonymous> (C:\Users\bagrmeg\Downloads\ignited-dashboard\node_modules\←[4mhandle-thing←[24m\lib\handle.js:120:12)
←[90m at Stream.emit (events.js:323:22)←[39m at endReadableNT (C:\Users\bagrmeg\Downloads\ignited-dashboard\node_modules\←[4mreadable-stream←[24m\lib\_stream_readable.js:1010:12)
←[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)←[39m
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! igniter@0.1.0 start: `set HTTPS=true&&react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the igniter@0.1.0 start 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\bagrmeg\AppData\Roaming\npm-cache\_logs\2020-11-11T14_28_53_501Z-debug.log
【问题讨论】: