[npm install现在总是抛出errno EACCES错误

编程入门 行业动态 更新时间:2024-10-10 16:23:02

[npm install现在总是<a href=https://www.elefans.com/category/jswz/34/1771043.html style=抛出errno EACCES错误"/>

[npm install现在总是抛出errno EACCES错误

[当我使用npm安装任何内容时(例如npm i json-stream

我收到以下错误:

npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! FetchError: request to  failed, reason: connect EACCES 104.16.25.35:443 - Local (0.0.0.0:0)
npm ERR!     at ClientRequest.<anonymous> (/Users/maxfowler/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:310:20)
npm ERR!     at TLSSocket.socketErrorListener (_http_client.js:426:9)
npm ERR!     at TLSSocket.emit (events.js:310:20)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:92:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm ERR!  FetchError: request to  failed, reason: connect EACCES 104.16.25.35:443 - Local (0.0.0.0:0)
npm ERR!     at ClientRequest.<anonymous> (/Users/maxfowler/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:310:20)
npm ERR!     at TLSSocket.socketErrorListener (_http_client.js:426:9)
npm ERR!     at TLSSocket.emit (events.js:310:20)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:92:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
npm ERR!   type: 'system',
npm ERR!   errno: 'EACCES',
npm ERR!   code: 'EACCES'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/maxfowler/.npm/_logs/2020-05-04T10_18_22_396Z-debug.log

我在Mac OS 10.14上使用nvm。我试过以sudo和其他工作目录运行命令。有什么想法吗?

我也尝试过ping 104.16.25.35(有效)和ping 104.16.25.35:443返回ping: cannot resolve 104.16.25.35:443: Unknown host

回答如下:

尝试以超级用户模式安装它,在sudo npm i json-stream之类的命令中添加sudo

更多推荐

[npm install现在总是抛出errno EACCES错误

本文发布于:2024-05-07 04:51:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1754318.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:抛出   错误   install   npm   errno

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!