2017-12-03 21 views
0

전 세계적으로 설치할 수있는 npm 패키지를 만들고 싶습니다. 패키지를 게시하고 새 버전을 게시 할 수는 있지만 전 세계적으로 설치하려는 경우 작동하지 않습니다.전 세계적으로 npm 패키지를 설치할 수 없습니다

yarn global add <package> 출력 :

success Installed "[email protected]" with binaries: 
    - pentest-tool-lite 

npm install -g <package> 출력 :

npm ERR! path /nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index 
npm ERR! code ENOENT 
npm ERR! errno -2 
npm ERR! syscall chmod 
npm ERR! enoent ENOENT: no such file or directory, chmod 'nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index' 
npm ERR! enoent This is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! A complete log of this run can be found in: 
npm ERR! _logs/2017-12-03T16_00_34_926Z-debug.log 

디버그 로그 :

7877 info linkStuff [email protected] 
7878 silly linkStuff [email protected] has /Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules as its parent node_modules 
7879 silly linkStuff [email protected] is part of a global install 
7880 silly linkStuff [email protected] is installed into a global node_modules 
7881 silly linkStuff [email protected] is installed into the top-level global node_modules 
7882 verbose linkBins [email protected] 
7883 verbose linkBins [ { 'pentest-tool-lite': './lib/index' }, 
7883 verbose linkBins '/Users/juffalow/.nvm/versions/node/v8.7.0/bin', 
7883 verbose linkBins true ] 
7884 verbose linkMans [email protected] 
7885 verbose unlock done using /Users/juffalow/.npm/_locks/staging-fa43d53d0ab27b11.lock for /Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/.staging 
7886 verbose stack Error: ENOENT: no such file or directory, chmod '/Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index' 
7887 verbose cwd /Users/juffalow/NetBeansProjects/pentest-tool-lite 
7888 verbose Darwin 16.0.0 
7889 verbose argv "/Users/juffalow/.nvm/versions/node/v8.7.0/bin/node" "/Users/juffalow/.nvm/versions/node/v8.7.0/bin/npm" "install" "-g" "pentest-tool-lite" 
7890 verbose node v8.7.0 
7891 verbose npm v5.4.2 
7892 error path /Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index 
7893 error code ENOENT 
7894 error errno -2 
7895 error syscall chmod 
7896 error enoent ENOENT: no such file or directory, chmod '/Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index' 
7897 error enoent This is related to npm not being able to find a file. 
7898 verbose exit [ -2, true ] 

실을 성공적으로 설치하는 것,하지만. NPM은 오류를 표시하지만 실제로 이유를 모르겠습니다. module에 대한 경험이 있습니까?

+0

당신이'_logs/2017-12-03T16_00_34_926Z-debug.log'에서 관련 로그를 붙여 넣을 수 있습니다 : 함께 프로젝트의 루트에 .npmignore 파일을 추가? – Michael

+0

원래 게시물을 편집했습니다. 고맙습니다! – juffalow

+0

nvm과 yarn과 같은 모든 쓰레기를 제거하십시오. 공식 웹 사이트에서 노드를 다시 설치하십시오. 그리고 다시 설치하십시오. 그것은 그 때 작동 할 것이다. –

답변

0

좋아, 문제가 발생했습니다. 전역 모듈을 npm에 게시하려면 빌드 버전 (예 : bin 또는 lib 폴더)을 게시해야합니다. 나는이 버전을 가지고 있었지만, repoot에있을 필요가 없기 때문에 .gitignore에서 무시되었습니다. 그리고 .npmignore이 없으면 npm은 .gitignore 파일을 사용하므로 모듈이 빌드 버전없이 게시되었으므로 실행 파일이 없습니다.

솔루션 :

node_modules/ 
coverage/