npm install --global babel-cli npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
こんな感じのエラーが出て、インストールできない時
$ mkdir ~/.npm-global $ npm config set prefix '~/.npm-global' ╭─────────────────────────────────────╮ │ │ │ Update available 5.6.0 → 6.9.0 │ │ Run npm i -g npm to update │ │ │ ╰─────────────────────────────────────╯ $ echo ' export PATH=~/.npm-global/bin:$PATH' >> ~/.bash_profile $ source ~/.bash_profile
そうすると動くようになった
$ npm install --global babel-cli + babel-cli@6.26.0 added 305 packages in 12.8s