【问题标题】:Mac error: /bin/sh: npm: command not foundMac 错误:/bin/sh: npm: command not found
【发布时间】:2020-01-28 03:42:52
【问题描述】:

我正在尝试构建 c++ 项目并看到以下错误: 请你看一下好吗?

/bin/sh: npm: command not found
make[2]: *** [modules/GUI/CMakeFiles/Client] Error 127
make[1]: *** [modules/GUI/CMakeFiles/Client.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

我关注了这个维基:sudo: npm: command not found 但这对我不起作用。

For MAC users, the follow steps worked for me, the error still there.

$ brew update
$ brew uninstall node
$ brew install node
$ brew postinstall 

【问题讨论】:

    标签: node.js macos makefile cmake


    【解决方案1】:

    你看到this了吗?

    你试过了吗:brew doctor

    当你这样做时你会得到什么:

    which node
    which npm
    

    如果你得到node 的任何东西,请寻找路径,看看附近有什么。

    最坏的情况,如果您没有向brew 添加任何其他内容,请考虑删除brew 并重新安装。

    仅供参考:对我来说,使用 nvm,我看到了这个:

    ➜  ~ which npm
    /Users/pgkehle/.nvm/versions/node/v11.15.0/bin/npm
    ➜  ~ which node
    /Users/pgkehle/.nvm/versions/node/v11.15.0/bin/node
    

    您的路径会有所不同,但请考虑nvm 作为替代方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-09-26
      • 2015-09-29
      • 2017-01-29
      • 2019-09-12
      • 2022-12-21
      • 2018-07-18
      • 2015-09-04
      相关资源
      最近更新 更多