작성
·
2.6K
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
답변 5
0
0
0
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
0
새로운 폴더를 만들어 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