在下载module时出现错误
npm install openai
(node:25160) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:25160) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:25160) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/openai failed, reason:
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
解决方案
如果你在中国大陆,可以使用淘宝的 npm 镜像来加速安装:
npm config set registry https://registry.npmmirror.com
然后安装:
npm install openai
恢复默认 registry:
npm config set registry https://registry.npmjs.org
标签:npm,node,Use,network,ERR,openai,registry,报错
From: https://blog.csdn.net/m0_74969428/article/details/144041704