到目前为止,我已经看过类似的问题,例如this issues和this one。解决方案似乎是:
rm package-lock.json
npm cache clean --force
npm install
npm start
Run Code Online (Sandbox Code Playgroud)
我已经尝试过这些步骤,但不断收到相同的错误:
rm package-lock.json
npm cache clean --force
npm install
npm start
Run Code Online (Sandbox Code Playgroud)
的输出/home/ubuntu/.npm/_logs/2021-12-20T09_28_07_369Z-debug.log是:
> client@0.1.0 start /home/ubuntu/react/client
> react-scripts --openssl-legacy-provider start
/usr/bin/node: bad option: --openssl-legacy-provider
npm ERR! code ELIFECYCLE
npm ERR! errno 9
npm ERR! client@0.1.0 start: `react-scripts --openssl-legacy-provider start`
npm ERR! Exit status 9
npm ERR!
npm ERR! Failed at the client@0.1.0 start script.
npm ERR! This is probably not a …Run Code Online (Sandbox Code Playgroud)