macにnodebrewでnodeを入れる
code:できないけど
$ nodebrew install-binary stable
Warning: Failed to create the file
Warning: /Users/xxxx/.nodebrew/src/v18.5.0/node-v18.5.0-darwin-x64.tar.gz:
Warning: No such file or directory
0.0%
curl: (23) Failed writing body (0 != 1125)
ディレクトリがないから?
yes
code:terminal
mkdir ~/.nodebrew
mkdir ~/.nodebrew/src
使う
useとPATH登録が必要そう
内部のがあるんだけどどうすればいい?
code:a
$ which node
/usr/local/bin/node
code:普通にbrew uninstall
$ brew uninstall node
Uninstalling /usr/local/Cellar/node/14.4.0... (4,659 files, 60.8MB)
$ node --vesion
-bash: /usr/local/bin/node: No such file or directory
$ npm --version
env: node: No such file or directory
んでは
code:a
$ nodebrew use v11.15.0
use v11.15.0
$ nodebrew ls
v11.15.0
v18.5.0
current: v11.15.0
bash_profileに追加する
code:元がこれ
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile
code:俺用にカスタム.bash_profile
export PS1="$ "
...
export NODEBREW_NODE=$HOME/.nodebrew/current/bin ★これ入れる感じかな
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
export PATH=$PY37:$GLOBAL_ALIAS:$PATH:$MYPATHDIR
反映されたかな?
code:a
$ editme
$ reload
$ node --version
v11.15.0
$