2017-10-09 2 views
0

는 내가 다운로드 한 것을 내 각 프로젝트에 node_module를 설치하려고 호출되지 CB를(),하지만 난이 오류를 얻을 : 다음NPM 오류 설치 -

npm ERR! registry error parsing json

내가 NPM npm intall npm -g를 사용하여 다시 설치 내가 사용하려고 할 때 후를

(node:11252) UnhandledPromiseRejectionWarning: Unhandled promise 
rejection (rejection id: 1): Error: ENOENT: no such file or directory, stat 
'C:\Users\User\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-ec5da46c\angular\cdk.es5.js' 

debug.log를 :

0 info it worked if it ends with ok 
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 
1 verbose cli 'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js', 
1 verbose cli 'install' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose npm-session ff5ce249dfe37f0e 
5 silly install runPreinstallTopLevelLifecycles 
6 silly preinstall [email protected] 
7 info lifecycle [email protected]~preinstall: [email protected] 
8 silly install loadCurrentTree 
9 silly install readLocalPackageData 
10 silly install loadIdealTree 
11 silly install cloneCurrentTreeToIdealTree 
12 silly install loadShrinkwrap 
13 info lifecycle @angular/[email protected]~prepack: @angular/[email protected] 
14 error cb() never called! 
15 error This is an error with npm itself. Please report this error at: 
16 error <https://github.com/npm/npm/issues> 

I npm install 나는이 오류 이미 npm cache clean --force 시도했지만 같은 오류가 발생합니다.

node -v v6.10.2 
npm -v 5.4.2 

답변

0

은이 유사 보일 것이다 당신의 각 프로젝트의 루트 내에서 package.json 파일이 있는지 확인합니다.

https://github.com/heroku/node-js-sample/blob/master/package.json

package.json 파일이있는 경우

, 당신은에 저장된 패키지를 얻을 수 npm install를 실행하고 당신을 위해 node_modules 디렉토리를 생성합니다.

그러나 파일이 없으면 npm i -y을 실행하여 npm을 초기화해야만 자동으로 package.json 파일을 만들고 노드 모듈을 설치할 수 있음을 의미합니다.

NB : 컴퓨터에 npm이 이미 설치되어 있으므로 npm install npm -g을 실행하는 것이 이상적이지 않습니다.

+0

'package.json'이 존재하며,이 프로젝트는 몇 주 전에 진행되었습니다. 하지만 지금은 자식을 복제하고이 오류가 발생합니다. – Vertigo

+0

'npm install'을 실행중인 프로젝트의 루트 디렉토리에 있는지 확인하십시오 –

+0

루트 디렉토리에서 실행 중입니다. 이제이 프로젝트를 다른 컴퓨터에 설치하고 문제가없는 node_modules을 설치 했으므로 문제는'npm'에 있다고 생각합니다. 아이디어가 있습니까? – Vertigo