program tip

캐시를 지운 후 npm이 작동하지 않음

radiobox 2020. 9. 23. 07:28
반응형

캐시를 지운 후 npm이 작동하지 않음


캐시를 지우기 전에

npm cache clear

npm이 잘 작동합니다. 캐시를 지운 후에는 작동하지 않습니다. 아래 오류 로그는 인터넷 연결 문제를 암시하지만 인터넷 연결은 괜찮습니다. 이 문제는 bower뿐만 아니라 모든 모듈에서 발생합니다.

다음은 프로세스의 출력입니다.

> sudo npm install -g bower Password: npm http GET
> https://registry.npmjs.org/bower npm http GET
> https://registry.npmjs.org/bower npm http GET
> https://registry.npmjs.org/bower npm ERR! network connect ETIMEDOUT
> npm ERR! network This is most likely not a problem with npm itself npm
> ERR! network and is related to network connectivity. npm ERR! network
> In most cases you are behind a proxy or have bad network settings. npm
> ERR! network npm ERR! network If you are behind a proxy, please make
> sure that the npm ERR! network 'proxy' config is set properly.  See:
> 'npm help config'
> 
> npm ERR! System Darwin 12.5.0 npm ERR! command
> "/usr/local/Cellar/node/0.10.16/bin/node" "/usr/local/bin/npm"
> "install" "-g" "bower" npm ERR! cwd /Users/username npm ERR!
> node -v v0.10.16 npm ERR! npm -v 1.3.8 npm ERR! syscall connect npm
> ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! npm ERR!
> Additional logging details can be found in: npm ERR!    
> /Users/username/npm-debug.log npm ERR! not ok code 0

그것은해야한다

npm cache clean  

참조 https://docs.npmjs.com/cli/cache.html를


이것은 나를 위해 일했습니다.

npm cache clean --force 

"npm @ 5부터는 npm 캐시가 손상 문제로자가 치유되고 캐시에서 추출 된 데이터의 유효성이 보장됩니다. 모든 것이 일관성이 있는지 확인하려면 다음을 사용하십시오.

npm cache verify

대신. "


npm cache clean --force그 실행 후에 이것을 시도하십시오npm cache verify


잘못된 명령을 입력 한 것 같습니다. npm이 캐시를 지우도록하는 올바른 명령은 다음과 같습니다.

npm cache clean --force 

하려고하다

npm cache clean 

그러나 npm은 npm (> 5)의 최신 버전에 자체 치유 메커니즘이 있으며 npm을 확인하기 위해해야 ​​할 모든 일은 확인하는 것입니다.

npm cache verify

npm 메시지 :

The npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. 

If you want to make sure everything is consistent, use 'npm cache verify' instead.

그러나 npm을 강제하려면 다음을 사용하십시오.

npm cache clean --force

시도 npm cache clean --force는 수동으로 다음 삭제를 작동하지 않을 경우 %appdata%\npm-cache폴더에 있습니다.

그것은 나를 위해 일했습니다.


npm cache clean --force
npm cache verify

이게 방법이야.


환경 경로가 제거되었을 수 있습니다.

입력하여 확인하십시오.

npm config get prefix

npm 바이너리가있는 위치 여야합니다.

창문 c:/users/username/AppData/Roaming/npm에서 그들이 발견되는 곳입니다.

이 위치를 환경 변수에 추가하십시오. 잘 작동합니다.

(제어판-> '환경 변수'검색 후 해당 이름의 버튼 클릭-> 경로 편집-> 위 위치 추가)


최신 버전의 NodeJS를 설치해야했습니다. 그것은 나를 위해 일했습니다.


try this one clear your npm cache with : npm cache clean --force after that run npm cache verify (just make sure disconnected your internet connection while you are clearing cache).


at npm@6.8.0 the command that is been supported is npm cache verify

참고URL : https://stackoverflow.com/questions/20259492/npm-not-working-after-clearing-cache

반응형