inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

Node.js 교과서 - 기본부터 프로젝트 실습까지

commander 사용하기

'CLI'바꾼 후, npm i -g , npm ERR! code EEXIST

2744

yesman

작성한 질문수 12

0

commander 'cli' 사용하기 위해, 

package.json 에서 bin 'commander.js'로 바꾸었습니다.

cli -v 해보았으나 터미널에서 새로운 cli를 인식을 하지 못하여,

제로초님 코드 그대로 package.json, cli를 'command.js' 로 바꾼 후, npm i -g를 했으나 node-module에서 계속 commander.js를 인식하고 있는 듯 합니다. 

stackoverflow등 확인을 해보고

1. npm update,

2. (package.json, node_modules, package-lock.json)을 제거한 후, npm i -g를 해보았으나 결과는 아래와 같이 반복됩니다..  

*폴더를 다시 만들어서 프로젝트를 진행을 해야할까요? 어떤 방법이 효율적인지 궁금합니다.. 

frankkim@Frankui-MacBookPro  ~/Desktop/NodeCLIproject/node-cli   master ● ?  npm i -g                                                                                    ✔  671  16:27:38 

npm ERR! code EEXIST

npm ERR! path /usr/local/bin/cli

npm ERR! Refusing to delete /usr/local/bin/cli: ../lib/node_modules/node-cli/commander.js symlink target is not controlled by npm /usr/local/lib/node_modules/node-cli

npm ERR! File exists: /usr/local/bin/cli

npm ERR! Remove the existing file and try again, or run npm

npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/frankkim/.npm/_logs/2020-01-26T21_28_16_088Z-debug.log

mongodb nodejs mysql javascript

답변 5

0

yesman

에러메시지 읽고 --force도 해봤지만 안됩니다 ㅠㅠ 다른 방법은 없을까요? 

0

제로초(조현영)

에러메시지에 답이 나와있네요. 명령어 뒤에 --force를 붙여보세요.

0

yesman

npm rm -g도 해봤지만 계속 refuse 하네요 ㅠㅠ

Mac유저여서 sudo npm rm -g도 해봤습니다...

npm ERR! code EEXIST

npm ERR! path /usr/local/bin/cli

npm ERR! Refusing to delete /usr/local/bin/cli: ../lib/node_modules/node-cli/commander.js symlink target is not controlled by npm /usr/local/lib/node_modules/node-cli

npm ERR! File exists: /usr/local/bin/cli

npm ERR! Remove the existing file and try again, or run npm

npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/frankkim/.npm/_logs/2020-01-27T15_02_39_021Z-debug.log

0

제로초(조현영)

npm rm -g 해보세요.

0

yesman

새로운 폴더를 만들어 npm init 하고 시작해보았으나 똑같은 현상이 일어납니다 ㅠㅠ

어떡하면 좋을까요?

 frankkim@Frankui-MacBookPro  ~/Desktop/NodeCLIproject/cli-project   master ?  npm i -g                                                                                   ✔  681  17:04:15 

npm ERR! code EEXIST

npm ERR! path /usr/local/bin/cli

npm ERR! Refusing to delete /usr/local/bin/cli: ../lib/node_modules/node-cli/commander.js symlink target is not controlled by npm /usr/local/lib/node_modules/cli-project

npm ERR! File exists: /usr/local/bin/cli

npm ERR! Remove the existing file and try again, or run npm

npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/frankkim/.npm/_logs/2020-01-26T22_04_40_697Z-debug.log

실제 서비스에서도 cluster를 사용하나요?

1

313

2

캐싱에 관하여

0

278

3

salt를 실무에서 사용할때 항상 randomBytes로 만들어줘야 하나요?

0

347

1

게시물 올리기 오류

0

407

1

캐슁 이후 로그인창

0

266

1

kakao passport 질문있습니다.

0

493

3

global객체 공유 질문드립니다.

1

417

1

서버가 죽어버리네요

0

1047

8

포링키 문제..

0

234

2

커넥션 플래시 설치문제

0

216

2

익스프레스 제너레이터? 설치문제

0

2585

6

redis 질문입니다.

0

305

1

9장 세션을 DB에 저장시 리다이렉션 오류 발생

0

874

8

프레임워크 선택에 관하여 질문이 있습니다.

0

300

3

시퀄라이즈 질문입니다 ! !

0

588

1

리뉴얼 강의 12강 socket.io에서 req.session접근 관련 질문

0

922

6

oAuth 질문입니다.

0

356

3

GCP 질문입니다.

0

366

1

Passport 모듈 로그인 구현관련

0

720

6

카카오 로그인 관련 질문입니다!!

0

606

4

스스로 해보기 10-16 nunjuncks 질문있습니다

0

499

5

제로초님 HTTP 완벽가이드 추천해주신거 너무 잘 읽었습니다.

0

317

2

gif채팅방 nunjucks관련 질문입니다!

0

337

3

현영님 몽고db관련 질문입니다.

0

233

3