脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|shell|

服务器之家 - 脚本之家 - Golang - goland中npm无法使用的问题及解决

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

2022-12-28 15:33西瓜味儿的柚子 Golang

这篇文章主要介绍了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!无法安装任何包的解决

?
1
2
npm config set proxy false
npm cache clean

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/m0_58181788/article/details/124281098

延伸 · 阅读

精彩推荐
  • GolangUbuntu下安装Go语言开发环境及编辑器的相关配置

    Ubuntu下安装Go语言开发环境及编辑器的相关配置

    这篇文章主要介绍了Ubuntu下安装Go语言开发环境及编辑器的相关配置,编辑器方面介绍了包括Vim和Eclipse,需要的朋友可以参考下 ...

    喝醉的毛毛虫5882020-04-29
  • GolangGolang中Interface接口的三个特性

    Golang中Interface接口的三个特性

    本文详细讲解了Golang中Interface接口的三个特性,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...

    WingPig8162022-07-19
  • GolangGo slice切片使用示例详解

    Go slice切片使用示例详解

    这篇文章主要为大家介绍了Go slice切片使用示例详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪...

    王中阳Go11802022-10-19
  • GolangGo和Java算法详析之分数到小数

    Go和Java算法详析之分数到小数

    这篇文章主要给大家介绍了关于Go和Java算法详析之分数到小数的相关资料,文中通过实例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价...

    黄丫丫10452022-11-08
  • GolangGo语言中的range用法实例分析

    Go语言中的range用法实例分析

    这篇文章主要介绍了Go语言中的range用法,实例分析了range的功能与使用技巧,具有一定参考借鉴价值,需要的朋友可以参考下 ...

    不是JS3752020-04-17
  • GolangGolang中map数据类型的使用方法

    Golang中map数据类型的使用方法

    这篇文章主要介绍了Golang中map数据类型的使用方法,文章围绕主题展开详细的内容戒杀,具有一定的参考价值,需要的朋友可以参考一下...

    7small77592022-11-14
  • Golang解决Goland中利用HTTPClient发送请求超时返回EOF错误DEBUG

    解决Goland中利用HTTPClient发送请求超时返回EOF错误DEBUG

    这篇文章主要介绍了解决Goland中利用HTTPClient发送请求超时返回EOF错误DEBUG,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...

    PrnyNing11592021-02-25
  • GolangGo压缩位图库roaring安装使用详解

    Go压缩位图库roaring安装使用详解

    这篇文章主要为大家介绍了Go压缩位图库roaring安装使用详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪...

    darjun3872022-07-22