解决方案
npm install -g cnpm --registry=https://registry.npmmirror.com
cnpm install –save-dev electron
npm install
下载报错
npm error code ENOTFOUND
npm error syscall getaddrinfo
npm error errno ENOTFOUND
npm error network request to http://registry.cnpmjs.org/axios failed, reason: getaddrinfo ENOTFOUND registry.cnpmjs.org
npm error network This is a problem related to network connectivity.
npm error network In most cases you are behind a proxy or have bad network settings.
npm error network
npm error network If you are behind a proxy, please make sure that the
npm error network 'proxy' config is set properly. See: 'npm help config'
npm error A complete log of this run can be found in: C:\Users\liron\AppData\Local\npm-cache\_logs\2025-02-28T10_05_22_174Z-debug-0.log
PS E:\Project\gitProject\weed_detection_project\frontend> npm config set registry https://registry.npmjs.org/
PS E:\Project\gitProject\weed_detection_project\frontend> npm install electron echarts axios
npm warn deprecated boolean@3.2.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn cleanup Failed to remove some directories [
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
npm error command C:\Windows\system32\cmd.exe /d /s /c node install.js
npm error RequestError: unable to verify the first certificate
npm error at ClientRequest.<anonymous> npm error at Object.onceWrapper (node:events:633:26)
npm error at ClientRequest.emit (node:events:530:35)
npm error at origin.emit timer\dist\source\index.js:43:20)
npm error at emitErrorEvent (node:_http_client:104:11)
npm error at TLSSocket.socketErrorListener (node:_http_client:518:5)
npm error at TLSSocket.emit (node:events:518:28)
npm error at emitErrorNT (node:internal/streams/destroy:170:8)
npm error at emitErrorCloseNT (node:internal/streams/destroy:129:3)
npm error at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
npm error at TLSSocket.onConnectSecure (node:_tls_wrap:1679:34)
npm error at TLSSocket.emit (node:events:518:28)
npm error at TLSSocket._finishInit (node:_tls_wrap:1078:8)
npm error at ssl.onhandshakedone (node:_tls_wrap:864:12)