Brew를 사용하여 최신 버전의 Node를 설치하는 방법
현재 NodeJ의 최신 버전은 0.4.1입니다.
brew install node
지금 명령 은 0.2.6을 설치합니다. 이상적이지 않습니다. 0.4.1을 부탁합니다
brew 명령 목록을 살펴보고 시도했습니다.brew install --HEAD node
그러나 이것은 0.5-pre 노드를 설치합니다.
왜 올바른 버전을 설치하지 않고 올바른 버전을 얻도록 강제 할 수 있습니까?
이 단계에서는 실제로 src를 다운로드하여 수동으로 설치하는 것이 더 쉬운 것처럼 보입니다. 그러나 나는 Brew와 함께 무슨 일이 일어나고 있는지 알고 싶습니다.
먼저 달려 봤어 brew update
? 그렇게하지 않으면 Homebrew는 공식을 업데이트 할 수 없으며 공식을 업데이트하지 않으면 최신 버전의 소프트웨어를 설치하는 방법을 모릅니다.
아래 순서대로 명령을 실행하십시오.
brew update
brew doctor
brew upgrade node
이제 업데이트 된 버전의 노드를 설치했으며 연결되지 않았을 수 있습니다. 그렇지 않은 경우 다음을 입력하십시오. brew link node
또는brew link --overwrite node
brew를 통해 노드를 설치 / 업그레이드 한 후이 문제가 발생했습니다. 노드 명령은 작동했지만 npm 명령은 작동하지 않았습니다.
이 명령을 사용하여 문제를 해결했습니다.
brew uninstall node
brew update
brew upgrade
brew cleanup
brew install node
sudo chown -R $(whoami) /usr/local
brew link --overwrite node
brew postinstall node
시행 착오 후에이 솔루션을 함께 사용했습니다 ...
github 스레드 : https://github.com/npm/npm/issues/3125
이 사이트 : http://developpeers.com/blogs/fix-for-homebrew-permission-denied-issues
brew update
하나의 패키지가 제대로 다운로드되지 않아서 때때로 실패합니다. 따라서 다음과 같이 특정 라이브러리를 업그레이드 할 수 있습니다.
brew upgrade node
https://gist.github.com/3005832
내가해야 할 일을했을 brew link --overwrite node
후 brew install node
0.4에서 0.8.18로 업데이트
또한 새 노드 버전을 설치 한 후 현재 노드 버전을 비활성화하십시오. 도움이됩니다.
nvm deactivate
$ PATH에서 /Users/user_name/.nvm/*/bin이 제거되었습니다.
그리고 그 노드가 업데이트 된 후
node --version
v10.9.0
"n"노드 매우 간단한 패키지 관리자를 사용하십시오.
> npm install -g n
"n"을 설치하면 다음을 수행하여 최신 노드를 가져올 수 있습니다.
> n latest
우분투 16.0x 및 MacOS 10.12 (Sierra)에서 성공적으로 사용했습니다.
를 통해 현재 노드를 설치 한 경우 Homebrew
다음 명령을 사용하십시오.
brew update
brew upgrade node
다음으로 노드 버전 확인
node -v
이 솔루션을 Homebrew 0.9.5와 함께 사용하면 최신 안정 버전의 노드로 업그레이드하는 빠른 솔루션처럼 보입니다.
brew update
최신 버전이 설치됩니다
brew install node
이것을 찾으려면 현재 버전의 노드 사용 node -v를 연결 해제하십시오.
brew unlink node012
This will change to the most up to date version of node.
brew link node
Note: This solution worked as a result of me getting this error:
Error: No such keg: /usr/local/Cellar/node
I did this on Mac OSX Sierra. I had Node 6.1 installed but Puppetter required Node 6.4. This is what I did:
brew upgrade node
brew unlink node
brew link --overwrite node@8
echo 'export PATH="/usr/local/opt/node@8/bin:$PATH"' >> ~/.bash_profile
And then open a new terminal window and run:
node -v
v8.11.2
The --overwrite is necessary to override conflicting files between node6 and node8
You can use nodebrew. It can switch node versions too.
If you're willing to remove the brew
dependency, I would recommend nvm - I can't really recommend it over any other versioning solution because I haven't needed to try anything else. Having the ability to switch instantly between versions depending on which project you're working on is pretty valuable.
Just go old skool - https://nodejs.org/en/download/current/ From there you can get the current or LTS versions
참고URL : https://stackoverflow.com/questions/5056115/how-to-install-latest-version-of-node-using-brew
'IT story' 카테고리의 다른 글
자바 스크립트 초에서 분 및 초 (0) | 2020.06.18 |
---|---|
jQuery 유효성 검사 필수 선택 (0) | 2020.06.18 |
MySQL에서 값이 숫자인지 감지 (0) | 2020.06.18 |
Javascript-innerHTML없이 컨테이너 요소에 HTML 추가 (0) | 2020.06.18 |
몽구스 스키마에 created_at 및 updated_at 필드 추가 (0) | 2020.06.18 |