재우니의 블로그

 

https://nodejs.org/en/download/

 

download 화면에서 mac 환경일 경우 marchintosh installer 를 선택합니다. 

현재 시점에는 v6.11.3 버전의 pkg 파일이 다운로드 될 겁니다. 이를 설치 하시면 됩니다.

 

 

 

[Homebrew를 통해 설치했을 경우]

    brew update

    brew upgrade node

    npm install -g npm

 

[pkg를 통해 설치했을 경우]

    npm install -g n

    npm cache clean -f

    sudo n stable

 

[문제가 있어서 재설치 할 경우]

    rm -rf /usr/local/lib/node_modules

    brew uninstall node

    brew install node --without-npm

    echo prefix=~/.npm-packages >> ~/.npmrc

    curl -L https://www.npmjs.com/install.sh | sh

    

[출처] :: Mac, Node JS 업그레이드 ::|작성자 그냥

 

https://velopert.com/1351

 

 

Last login: Fri Sep 29 00:12:33 on ttys000

sim-ui-MacBook-Air:~ shimjaewoon$ node -v

v8.6.0

sim-ui-MacBook-Air:~ shimjaewoon$ sudo npm cache clean -f

Password:

npm WARN using --force I sure hope you know what you are doing.

sim-ui-MacBook-Air:~ shimjaewoon$ sudo npm install -g n

/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n

+ n@2.1.8

updated 1 package in 1.872s

sim-ui-MacBook-Air:~ shimjaewoon$ sudo n stable

sim-ui-MacBook-Air:~ shimjaewoon$ node -v

v8.6.0

sim-ui-MacBook-Air:~ shimjaewoon$ npm -v

5.3.0

sim-ui-MacBook-Air:~ shimjaewoon$ sudo npm install -g npm

/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js

/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js

+ npm@5.4.2

added 21 packages, removed 111 packages and updated 19 packages in 17.35s

sim-ui-MacBook-Air:~ shimjaewoon$ npm -v

5.4.2

sim-ui-MacBook-Air:~ shimjaewoon$