权限被拒绝在 macOS Sierra 上为 odoo 9 安装 sudo brew node

Permission denied installing sudo brew node for odoo 9 on macOS Sierra

我正在尝试在 macOS Sierra 上安装 Odoo v9。我把它安装在 virtualenv 下,但是当我 运行 它 (odoo.py) 我得到一个无法执行命令 lessc。我发现了这个:

https://dedyyuristiawan.blogspot.com/2016/07/installation-odoo-on-mac-os-x-error.html

但是当我尝试 运行 sudo brew ... 我得到这个错误:

Error : Running Homebrew as root is extremely dangerous and no longer supported.

我 运行 它没有 sudo 但我得到:

Error: Permission denied - usr/local/lib/node_modules/npm/.github/issue_template.md

当我 运行 brew doctor 我得到:

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/mars/odoo-env/bin/python-config
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  node

所以我运行这个:

(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew cleanup
(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew link node
Linking /usr/local/Cellar/node/7.2.0... 
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'
To force the link and overwrite all conflicting files:
  brew link --overwrite node
To list all files that would be deleted:
  brew link --overwrite --dry-run node
(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew cleanup
(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew link node
Linking /usr/local/Cellar/node/7.2.0... 
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node

有人知道解决方法吗?

执行此操作就可以了: sudo chown -R $(whoami):admin /usr/local/lib/node_modules/