Program Club

bower를 최신 버전으로 업데이트하는 데 문제가 있습니다.

proclub 2020. 12. 25. 00:10
반응형

bower를 최신 버전으로 업데이트하는 데 문제가 있습니다.


나는 정자를 사용하고 있습니다

$ bower -v
0.9.2

최신 버전의 bower는 1.xx https://github.com/bower/bower/releases입니다.

나는 bower를 최신 버전으로 업데이트하기 위해 실행합니다.

npm update -g bower 

이것은 도움이되지 않는다

나는 아직도 가지고있다

$ bower -v
0.9.2

1) npm 캐시를 지운 다음 bower를 업데이트해야합니다.

sudo npm cache clean
npm update -g bower

2) 첫 번째 해결책이 도움이되지 않는 경우

제거하고 다시 설치하십시오.

npm -g uninstall bower
npm -g install bower

아직 여기 있는지 확인

which bower

다음과 같은 것을 보여줄 경우

/usr/local/bin/bower

그때

rm <path from previous command>

다시 설치 한 후

npm -g install bower

새 bash 창을 열고 최신 버전의 bower를 즐기십시오.

다른 패키지에도 도움이 될 것입니다.


여기에 움직이는 부분이 많이있을 수 있습니다. 먼저 시도해야합니다

npm cache clean
sudo npm cache clean
npm update -g bower

… 움직이는 부분이 모두 주어지면 작동하지 않을 가능성이 큽니다.

Mac에서 brew 및 nvm을 사용하여 일부 기록을 사용하면 다음과 같이 할 수 있습니다.

1. 정자가 지금 어디에 있는지 알아 내십시오

 $ which bower
 /usr/local/share/npm/bin/bower
 $ ls -hal /usr/local/share/npm/bin/bower
 lrwxr-xr-x  1 iwein  admin    35B Dec 15  2013 /usr/local/share/npm/bin/bower -> ../lib/node_modules/bower/bin/bower
 $ ls -hal /usr/local/share/npm/lib/node_modules/bower/bin/bower 
 -rwxr-xr-x  1 iwein  staff   3.3K Sep 17  2013 /usr/local/share/npm/lib/node_modules/bower/bin/bower
 $ bower -v
 1.2.8
 $ rm -rf /usr/local/share/npm/lib/node_modules/bower

2. npm을 사용하여 bower 재설치

 $ npm install -g bower
 /Users/iwein/.nvm/v5.11.1/bin/bower -> /Users/iwein/.nvm/v5.11.1/lib/node_modules/bower/bin/bower
 /Users/iwein/.nvm/v5.11.1/lib
 └── bower@1.7.9

 $ bower -v
 bash: /usr/local/share/npm/bin/bower: No such file or directory
 $ which bower
 /Users/iwein/.nvm/v5.11.1/bin/bower
 $ bower
 bash: /usr/local/share/npm/bin/bower: No such file or directory
 $ ls -hal ~/.nvm/v5.11.1/bin/bower
 lrwxr-xr-x  1 iwein  staff    35B Jun  1 11:53 /Users/iwein/.nvm/v5.11.1/bin/bower -> ../lib/node_modules/bower/bin/bower

3. 새 터미널을 엽니 다.

…or source your .profile or whatever. Check if you're using the same node version (implying a different nvm version if you don't)

 $ which bower
 /Users/iwein/.nvm/v0.10.24/bin/bower
 $ bower -v
 1.4.1
 $ nvm use 5
 Now using node v5.11.1
 $ which bower
 /Users/iwein/.nvm/v5.11.1/bin/bower
 $ bower -v
 1.7.9

And you're good.

Note that:

  1. you have to make sure you are installing in the right place, you may need multiple versions of bower, nvm, npm or node on your system for different projects…
  2. you need to restart the terminal to make sure the linking is done correctly.

Probably the bower update worked fine, it's just missing update environment var.

On my Ubuntu was something like:

ln -sf /usr/local/n/versions/node/6.2.0/bin/bower /usr/bin/bower

ReferenceURL : https://stackoverflow.com/questions/22585790/problems-updating-bower-to-the-latest-version

반응형