Angular CLI를 제거하는 방법은 무엇입니까?
Angular-CLI를 설치했지만 오류가 표시됩니다. 를 사용하여 새 프로젝트를 만들 때 ng app
다음 오류가 발생합니다.
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
TypeError: path must be a string or Buffer
at TypeError (native)
그래서 Angular-CLI를 제거하고 싶습니다.
다음 명령을 사용하여 제거하십시오.
npm uninstall -g @angular/cli
npm cache clean --force
확인하려면 : ng --version / * 오류 메시지가 표시되면 제거했습니다. * /
다음 명령을 사용하여 다시 설치하십시오.
npm install -g @angular/cli
참고 : -모든 캐시를 정리하기 위해 --force 사용-Windows에서는 관리자를 사용하여 실행 -Mac 에서는 sudo ( $ sudo <command>
) 사용
- 사용중인 경우
npm>5
대신 캐시 확인을 사용해야 할 수 있습니다. ($ npm cache verify
)
위의 솔루션 중 어느 것도 나에게 적합하지 않았습니다. Windows 7에서는 다음과 같이 작동했습니다.
Rapid Environment Editor를 설치 하고 노드에 대한 항목을 제거하십시오.npm, angular-cli or @angular/cli
node.js를 제거하고 다시 설치하십시오. Rapid Environment Editor를 다시 실행하고 node.js 및 npm이 시스템 또는 사용자 경로에 있는지 확인합니다. 다음을 사용하여 기존 ng 버전을 제거하십시오.
npm uninstall -g angular-cli
npm uninstall -g @angular/cli
npm cache clean
C:\Users\YOU\AppData\Roaming\npm\node_modules\@angular
폴더를 삭제하십시오 .
재부팅하고 마지막으로 다음을 실행하십시오.
npm install -g @angular/cli
그런 다음 숨을 멈추고 ng -v를 실행하십시오. 운이 좋으면 사랑을 얻을 수 있습니다. ng 명령을 실행할 때마다 숨을 참으십시오. ng가 정상적으로 실행 된 후 'command not found'가 마법처럼 여러 번 나에게 다시 나타 났고 문제가 해결되었다고 생각했기 때문입니다.
다음 명령을 실행하여 최신 각도를 얻으십시오.
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli@latest
npm install
전역 참조 제거
npm uninstall -g angular-cli
npm cache clean
Angular CLI는 @angular/cli
github readme에서와 같이 로 이동했습니다 .
sudo npm uninstall -g @angular/cli
npm cache clean
전역 적으로 제거하려면 아래 명령을 실행하십시오.
npm uninstall -g @angular/cli
완료되면 아래 명령을 실행하여 캐시를 지우십시오.
npm cache clean
이제 Angular의 latset 버전을 설치하려면 다음을 실행하십시오.
npm install -g @angular/cli@latest
Angular CLI에 대한 자세한 내용은 Angular 소개 및 CLI 가이드 를 참조하세요.
최근에 Mac에서 직접 ng 폴더를 제거해야했습니다 /usr/local/bin
. 너무 오래 전에 Angular CLI를 설치했기 때문에 원래 어떻게 설치했는지 잘 모르겠습니다.
I tried all the above things, and still ng as sticking around globally. So in powershell I ran Get-Command ng
, and then it became clear what my problem was. I was using yarn heavily in the past, and all the old angular cli packages were also installed globally in the yarn cache location. I deleted my yarn cache for good measure, but probably could have just updated the global angular cli via yarn. In any case, I hope this helps remind some of you that if you use yarn, then global commands like ng can also live in another path than where npm puts them.
use following command if you installed in globally,
npm uninstall -g angular-cli
Run this command npm uninstall angular-cli
Not the answer for your question, but the answer to the problem you mentioned:
It looks like you have wrong configuragion file for the angular-cli version you are using.
In angular-cli.json file, try to change the following:
from:
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
to:
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
$ npm uninstall -g angular-cli
$ npm cache clean
$ npm install -g angular-cli
Simplest workaround to continue working in your project is comment line 25 of node_modules/angular-cli/bin/ng:
// Version.assertPostWebpackVersion();
Until it is fixed properly.
참고URL : https://stackoverflow.com/questions/39566257/how-to-uninstall-angular-cli
'developer tip' 카테고리의 다른 글
Android : UnknownHostException (0) | 2020.11.06 |
---|---|
Ruby 설치 후 MAC OS X에서 잘못된 활성 개발자 경로 (0) | 2020.11.06 |
NSDictionary 개체의 NSArray를 정렬하는 가장 좋은 방법은 무엇입니까? (0) | 2020.11.06 |
svn : mergeinfo를 사용하여 TortoiseSVN을 끄는 방법이 있습니까? (0) | 2020.11.05 |
웹 페이지 하단 / 상단의 자바 스크립트? (0) | 2020.11.05 |