Reactjs: npm start error- Access to process.binding(‘http_parser’) is deprecated

huangapple go评论118阅读模式
英文:

Reactjs: npm start error- Access to process.binding('http_parser') is deprecated

问题

无法运行 npm start,尝试 npm start 后出现错误:

(node:5132) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:386:16)
    at handleParseError (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:434:10)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:466:5
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:327:12
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:386:16)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:418:10
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:293:13
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\babel-loader\lib\index.js:51:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v19.7.0
英文:

not able to run the npm start
After trying to npm start, it's giving error of

(node:5132) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:386:16)
    at handleParseError (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:434:10)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:466:5
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:327:12
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:386:16)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:418:10
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\webpack\lib\NormalModule.js:293:13
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\Web Development\Projects\Warehouse-Management\warehouse-management-client\node_modules\babel-loader\lib\index.js:51:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v19.7.0

I've tried in many ways like remove and reinstall node_modules & react-scripts, uninstall many dependencies, restart projects, update node version. But still not solving.

答案1

得分: 1

经过很长时间,我终于解决了这个问题。

npm audit fix --force

这对我来说是一个救星。

祝愉快编码

英文:

After long time I can solve this.

npm audit fix --force

This was rescuer to me.

> Happy coding

答案2

得分: 1

  1. 删除 node_modules 文件夹。
  2. 运行 npm install 以获得最新的依赖。
  3. 然后执行 npm audit fix --force

这应该解决您的问题。还要记得使用 Node 的 LTS 版本。

英文:
  1. Delete the node_modules folder.
  2. Do fresh npm install.
  3. Then do npm audit fix --force.

This should solve your issue. Also, remember to use node LTS version.

huangapple
  • 本文由 发表于 2023年3月7日 14:42:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/75658717.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定