goland中npm無法使用的問題及解決
goland中npm無法使用
明明已經(jīng)成功安裝且配置了環(huán)境到windows上,而且goland上的配置也絲毫無錯(cuò),但是就是不能使用npm,讓人苦惱,如果你也遇到了這樣的問題,希望這篇文章可以幫到你。
出現(xiàn)的錯(cuò)誤代碼是這樣的
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的配置文件所在位置。
當(dāng)然,尋找這個(gè)文件的目的,多數(shù)是為了修改.npmrc文件內(nèi)容。
但npm提供了方便快捷的修改方式,不知道這個(gè)文件的位置,其實(shí)也是可以修改的。
于是,配置之間就產(chǎn)生了沖突,找到他刪掉它就可以了
默認(rèn)位置是在 C:\Users\Lenovo 它是隱藏的

之后就可以繼續(xù)我們的項(xiàng)目了,拜拜
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
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Go語言標(biāo)準(zhǔn)庫中math模塊詳細(xì)功能介紹與示例代碼
Go語言的標(biāo)準(zhǔn)庫math提供了一系列基礎(chǔ)數(shù)學(xué)函數(shù)和常量,用于進(jìn)行科學(xué)計(jì)算、幾何計(jì)算和其他數(shù)學(xué)相關(guān)的操作,這篇文章主要介紹了Go語言標(biāo)準(zhǔn)庫中math模塊詳細(xì)功能介紹與示例代碼,需要的朋友可以參考下2025-03-03
Go語言中實(shí)現(xiàn)打印堆棧的errors包的用法詳解
因?yàn)镚o語言提供的錯(cuò)誤太簡單了,以至于簡單的我們無法更好的處理問題,所以誕生了很多對錯(cuò)誤處理的庫,github.com/pkg/errors是比較簡潔的一樣,本文就來聊聊它的具體用法吧2023-07-07
本地使用Docker搭建go開發(fā)環(huán)境的全過程
最近想學(xué)習(xí)一下golang,自己之前一直把環(huán)境全部安裝在docker上,所以這次也想把golang的環(huán)境安裝在docker上,下面這篇文章主要給大家介紹了關(guān)于本地使用Docker搭建go開發(fā)環(huán)境的相關(guān)資料,需要的朋友可以參考下2022-07-07

