现在用brew通过npm安装节点的方法是什么

use*_*695 5 macos homebrew node.js npm

我在我的macOS上安装了节点

brew install node
Run Code Online (Sandbox Code Playgroud)

执行此操作后,节点已正确安装:

$ node -v
  v8.4.0
Run Code Online (Sandbox Code Playgroud)

但跑步

$ npm -v
Run Code Online (Sandbox Code Playgroud)

给我 -bash: /usr/local/bin/npm: No such file or directory

现在通过brew安装npm节点的方法是什么?

brew install node 默认情况下使用--without-npm

小智 2

我有同样的问题。我跑去$ brew doctor确保节点首先被链接。然后我跑
$ brew postinstall node

$ npm -v现在应该显示版本号。