Programing

npm-EPERM : Windows에서 허용되지 않는 작업

lottogame 2020. 10. 16. 07:01
반응형

npm-EPERM : Windows에서 허용되지 않는 작업


나는 달렸다

npm config set prefix /usr/local

해당 명령을 실행 한 후 Windows OS에서 npm 명령을 실행하려고하면 계속해서 아래와 같은 메시지가 표시됩니다.

Error: EPERM: operation not permitted, mkdir 'C:\Program Files (x86)\Git\local'
at Error (native)

에서 모든 파일을 삭제했습니다.

C:\Users\<your username>\.config\configstore\

그것은 작동하지 않았다.

어떠한 제안 ?


이 명령을 실행하는 것은 내 실수였습니다.

npm 구성 세트 접두사 / usr / local

경로 /usr/local는 Windows 용이 아닙니다. 이 명령은 다음 위치에서 접두사 변수를 변경했습니다.'C:\Program Files (x86)\Git\local'

이 디렉토리에 액세스하고 변경하려면 관리자 권한으로 cmd를 실행해야합니다.

그래서 나는 :

  1. 관리자 권한으로 cmd 실행
  2. 실행 npm config edit(메모장 편집기가 나타납니다)
  3. prefix변수를 다음으로 변경C:\Users\<User Name>\AppData\Roaming\npm

그런 다음 npm start일반 콘솔에서 작동합니다.


이전에 대한 Windows 사용자 액세스를 변경하여 문제를 해결했습니다.

다음은 스크린 샷입니다 : http://prntscr.com/djdn0g

여기에 이미지 설명 입력


이는 Windows가 사용자에게 시스템 드라이브 내에 폴더를 만들 수있는 권한을 부여하지 않기 때문에 발생합니다. 이를 해결하려면 :

마우스 오른쪽 버튼으로 클릭

폴더> 속성 > 보안

편집클릭하여 권한을 변경하고> 사용자를 선택하고 해당 사용자에게 모든 권한을 부여 합니다.


최근에 새 버전으로 업그레이드 할 때 동일한 문제가 발생했습니다. 유일한 해결책은 다운 그레이드 된

제거하려면 :

npm uninstall npm -g

이전 버전을 설치합니다.

npm install npm@5.3 -g

잠시 후에 버전을 업데이트하십시오.


때때로 필요한 것은 패키지를 설치 / 업데이트하기 전에 개발 서버를 중지하는 것입니다.


제 경우에는 npm install. 편집기를 닫고 npm install명령 줄을 실행하여 문제를 해결했습니다 .


npm을 업데이트 한 후에도 동일한 문제가 발생했습니다. 다음을 사용하여 최신 npm을 다시 설치하여 문제를 해결했습니다.

npm i -g npm

그러나 이번에는 cmd가 관리 모드에서 실행됩니다.

업데이트에 문제가 있다고 생각했기 때문에이 모든 작업을 수행했습니다. 대부분 파일이 누락되었습니다.


저는 Windows 10을 사용합니다. CMD를 관리자로 시작했는데 문제가 해결되었습니다.

CMD를 찾아 마우스 오른쪽 버튼으로 클릭 한 다음 관리자 권한으로 열기를 클릭합니다.


나에게는 node_module의 기존 폴더를 변경하는 문제 였으므로 전체 폴더를 nuk하고 npm install을 다시 실행했습니다. 그 후 오류없이 작동합니다.


npm 패키지를 설치하려고 할 때 동일한 문제가 발생했습니다 AVA. 나를위한 해결책은 node_modules 폴더를 삭제하고 npm 캐시를 강제 청소하는 것입니다.

rm -rf node_modules
npm cache clean --force

그런 다음 문제없이 npm 패키지를 설치할 수 있습니다.


회사 LAN을 사용할 때와 같은 문제가 발생했습니다. 그리고 방금 실행 cmd.exe npm했고 그 후 오류없이 다른 명령을 실행할 수있었습니다.

C:\Users\586656>cmd.exe npm
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

사무실 LAN에서 이것을 시도하는 다른 사람들에게 도움이 될 수 있으므로 이것을 공유하십시오. 감사합니다.


cmd를 관리자로 실행하십시오. 이전 node_modules 폴더를 삭제하고 npm install을 다시 실행하십시오.


폴더 / 파일이 다른 프로세스에 의해 잠 겼기 때문에 나에게 일어났습니다. 도구 (LockHunter)를 사용하여 해당 프로세스를 종료하고 다시 작동하기 시작했습니다 (가능한 이유).


이 명령 npm cache clean을 빠르고 간단하게 오류에 대한 해결책으로 찾으십시오 !


노드 버전을 8.9.4로 업데이트하고 관리자 명령 프롬프트에서 필요한 설치 명령을 다시 실행했습니다. 그것은 나를 위해 일했습니다!


내 노트북을 재부팅 한 다음

npm install

나를 위해 일했습니다!


CMD를 관리자로 실행하여 npm 패키지를 설치하십시오. npm install throwing error EPERM 에서이 버그에 대한 광범위한 토론으로 이동할 수 있습니다 .


Windows Powershell에서 npm 명령을 실행하면 문제가 해결되었습니다.


npm i -g npm을 시도하십시오. NPM 버전 6.9가 저에게 효과적입니다.


나에게도 내 솔루션은 Android 스튜디오, AVD Manager, Visual Studio를 닫고 다시 설치했습니다. 내 expo cli를 업데이트하기 위해이 명령을 실행했습니다.

npm install -g expo-cli

가장 간단한 방법

이 게시물에 너무 늦지 않았기를 바라지 만 최근에 나도이 문제에 맞았습니다. 또한 내 노트북에 대한 관리자 권한도 없었습니다.

버그를 수정하는 가장 간단한 방법은 다음과 같습니다.

  1. 파일 이름을 찾습니다 .npmrc(에 있음 C:\Users\<user name>\.npmrc).
  2. 그것을 열고 경로 변경 prefix=에를prefix=C:\Users\<user name>\AppData\Roaming\npm

도움이 되길 바랍니다 ..


바이러스 백신 소프트웨어로 인해이 오류가 발생할 수도 있습니다. 제 경우에는이 오류를 일으킨 사용자 폴더를 보호하는 Windows 보안의 Ransomware Protection이 있습니다.


오래된 버전의 npm. 이 문제를 해결하기 위해 일련의 명령을 실행했습니다.

npm cache clean --force

그때:

npm install -g npm@latest --force

그런 다음 (다시 한 번) :

npm cache clean --force

그리고 마침내 내가 본 오류없이 이것을 (Angular 프로젝트 설치) 실행할 수있었습니다 EPERM.

ng new myProject

나에게는 .npmrc 파일의 문제였습니다. C : \ Users \ myname.npmrc에 있습니다. .npmrc 파일의 내용이 변경되었습니다. 동료 노트북과 비교하여 내용을 변경했습니다. 그래서 해결되었습니다.

참고로 .npmrc 파일의 내용도 추가하고 있습니다.

 ;;;;
 ;npm userconfig file
 ;this is a simple ini-formatted file
 ;lines that start with semi-colons are comments.
 ;read `npm help config` for help on the various options
 ;;;;

 //registry.npmjs.org/:_authToken=95632bcf-3056-4538-b57d-38426736e3a0
 scope=true
 @true:registry=https://registry.npmjs.org/

 ;;;;
 ;all options with default values
 ;;;;
 ;access=null

 ;allow-same-version=false

 ;always-auth=false

 ;also=null

 ;audit=true

 ;audit-level=low

 ;auth-type=legacy

 ;before=null

 ;bin-links=true

 ;browser=null

 ;ca=null

 ;cafile=undefined

 ;cache=C:\Users\myname\AppData\Roaming\npm-cache

 ;cache-lock-stale=60000

 ;cache-lock-retries=10

 ;cache-lock-wait=10000

 ;cache-max=null

 ;cache-min=10

 ;cert=null

 ;cidr=null

 ;color=true

 ;depth=null

 ;description=true

 ;dev=false

 ;dry-run=false

 ;editor=notepad.exe

 ;engine-strict=false

 ;force=false

 ;fetch-retries=2

 ;fetch-retry-factor=10

 ;fetch-retry-mintimeout=10000

 ;fetch-retry-maxtimeout=60000

 ;git=git

 ;git-tag-version=true

 ;commit-hooks=true

 ;global=false

 ;globalconfig=C:\Users\myname\AppData\Roaming\npm\etc\npmrc

 ;global-style=false

 ;group=0

 ;ham-it-up=false

 ;heading=npm

 ;if-present=false

 ;ignore-prepublish=false

 ;ignore-scripts=false

 ;init-module=C:\Users\myname\.npm-init.js

 ;init-author-name=

 ;init-author-email=

 ;init-author-url=

 ;init-version=1.0.0

 ;init-license=ISC

 ;json=false

 ;key=null

 ;legacy-bundling=false

 ;link=false

 ;local-address=undefined

 ;loglevel=notice

 ;logs-max=10

 ;long=false

 ;maxsockets=50

 ;message=%s

 ;metrics-registry=null

 ;node-options=null

 ;node-version=10.15.2

 ;offline=false

 ;onload-script=null

 ;only=null

 ;optional=true

 ;otp=null

 ;package-lock=true

 ;package-lock-only=false

 ;parseable=false

 ;prefer-offline=false

 ;prefer-online=false

 ;prefix=C:\Program Files\nodejs

 ;preid=

 ;production=false

 ;progress=true

 ;proxy=null

 ;https-proxy=null

 ;noproxy=null

 ;user-agent=npm/{npm-version} node/{node-version} {platform} {arch}

 ;read-only=false

 ;rebuild-bundle=true

 ;registry=https://registry.npmjs.org/

 ;rollback=true

 ;save=true

 ;save-bundle=false

 ;save-dev=false

 ;save-exact=false

 ;save-optional=false

 ;save-prefix=^

 ;save-prod=false

 ;scope=

 ;script-shell=null

 ;scripts-prepend-node-path=warn-only

 ;searchopts=

 ;searchexclude=null

 ;searchlimit=20

 ;searchstaleness=900

 ;send-metrics=false

 ;shell=C:\windows\system32\cmd.exe

 ;shrinkwrap=true

 ;sign-git-commit=false

 ;sign-git-tag=false

 ;sso-poll-frequency=500

 ;sso-type=oauth

 ;strict-ssl=true

 ;tag=latest

 ;tag-version-prefix=v

 ;timing=false

 ;tmp=C:\Users\myname\AppData\Local\Temp

 ;unicode=false

 ;unsafe-perm=true

 ;update-notifier=true

 ;usage=false

 ;user=0

 ;userconfig=C:\Users\myname\.npmrc

 ;umask=0

 ;version=false

 ;versions=false

 ;viewer=browser

 ;_exit=true

 ;globalignorefile=C:\Users\myname\AppData\Roaming\npm\etc\npmignore

참고 URL : https://stackoverflow.com/questions/34600932/npm-eperm-operation-not-permitted-on-windows

반응형