阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

goland中npm无法使用的问题及解决方法

37次阅读
没有评论

共计 1950 个字符,预计需要花费 5 分钟才能阅读完成。

导读 这篇文章主要介绍了 goland 中 npm 无法使用的问题及解决方案,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
goland 中 npm 无法使用

明明已经成功安装且配置了环境到 windows 上,而且 goland 上的配置也丝毫无错,但是就是不能使用 npm,让人苦恼,如果你也遇到了这样的问题,希望这篇文章可以帮到你。

出现的错误代码是这样的

PS C:\Users\Lenovo\GolandProjects\shop_client1> npm install
npm WARN logfile could not be created: Error: EPERM: operation not permitted, open 'D:\AAA\nodejs\node_cache\_logs\2022-04-19T11_00_18_499Z-debug-0.log'
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path D:\AAA\nodejs\node_cache\_cacache\index-v5\7b\bf
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'D:\AAA\nodejs\node_cache\_cacache\index-v5\7b\bf'
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'D:\AAA\nodejs\node_cache\_cacache\index-v5\7b\bf'] {        
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'D:\\AAA\\nodejs\\node_cache\\_cacache\\index-v5\\7b\\bf'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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! Log files were not written due to an error writing to the directory: D:\AAA\nodejs\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

.npmrc 文件,就是 npm 的配置文件所在位置。

当然,寻找这个文件的目的,多数是为了修改.npmrc 文件内容。

但 npm 提供了方便快捷的修改方式,不知道这个文件的位置,其实也是可以修改的。

于是,配置之间就产生了冲突,找到他删掉它就可以了

默认位置是在 C:\Users\Lenovo 它是隐藏的

goland 中 npm 无法使用的问题及解决方法

之后就可以继续我们的项目了,拜拜

logfile could not be created: Error: EPERM: operation not permitted, open 'D:\AAA\nodejs\node_cache\_logs\2022-04-19T11_02_14_336Z-debug-0.log'
[..................] | : WARN logfile could not be created: Error: EPERM: operation not permitted, open 'D:\AAA\node 
> mintshop-client@1.0.0 dev
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
npm ERR! 无法安装任何包的解决
npm config set proxy false
npm cache clean

阿里云 2 核 2G 服务器 3M 带宽 61 元 1 年,有高配

腾讯云新客低至 82 元 / 年,老客户 99 元 / 年

代金券:在阿里云专用满减优惠券

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2024-07-24发表,共计1950字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中