【问题标题】:bash: bower: command not found, I have no idea what to dobash: bower: 找不到命令,我不知道该怎么办
【发布时间】:2016-09-02 04:16:49
【问题描述】:

很抱歉成为创建类似主题的 100 万人,但我真的阅读了所有其他人,他们根本没有帮助我。我尝试通过以下方式正确设置“路径”:set PATH=%PATH%;C:\Users\ "Your username" \AppData\Roaming\npm。不管我怎么努力,它仍然不起作用。我已经尝试重新安装它,甚至在我的主驱动器上重新安装 GIT,只是为了看看路径是否会有差异,但仍然为零。在这里,我粘贴了我的 GIT 提示符的输出。如果有人对如何解决它有任何想法,我愿意接受建议。

$ npm install -g bower
D:\Programs\GIT\Git\usr\local\bower -> D:\Programs\GIT\Git\usr\local\node_mods\bower\bin\bower
bower@1.7.9 D:\Programs\GIT\Git\usr\local\node_modules\bower

Kosio@User MINGW64 ~/Desktop/Web Projects/RESTful API/bookstore/client
$ which bower
which: no bower in (/c/Users/Kosio/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/:/mingw64/bin:/usr/bin:/c/Users/Kosio/bin:/c/Program Files (x86)/NVIDIA Corpoion/PhysX/Common:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Il/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDO/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Prograiles/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Il(R) Management Engine Components/IPT:/c/Program Files (x86)/Intel/Intel(R) Mgement Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Managementgine Components/IPT:/c/Program Files (x86)/Intel/OpenCL SDK/2.0/bin/x86:/c/Pram Files (x86)/Intel/OpenCL SDK/2.0/bin/x64:/c/Program Files (x86)/Windows LiShared:/c/Program Files (x86)/MiKTeX 2.9/miktex/bin:/c/Program Files (x86)/Gtarp/2.12/bin:/c/Program Files (x86)/Skype/Phone:/c/WINDOWS/system32/config/symprofile/.dnx/bin:/c/Program Files/Microsoft DNX/Dnvm:/d/Programs/Node JS:/cmc/Program Files/MongoDB/Server/3.2/bin:/usr/bin/vendor_perl:/usr/bin/core_per

【问题讨论】:

    标签: node.js git bash bower


    【解决方案1】:

    看起来您正在使用 Git Bash。此命令不适用于设置PATH

    PATH=%PATH%;C:\Users\ "Your username" \AppData\Roaming\npm
    

    试着这样写:

    PATH="$PATH:/c/Users/username/AppData/Roaming/npm"
    

    或者这也可以,但我现在无法测试:

    PATH="$PATH:"'C:\Users\username\AppData\Roaming\npm'
    

    另外你PATH 很长。我建议使用自定义的PATH,仅包含 Node.js 开发所必需的路径,以减少噪音和意外行为。

    【讨论】:

      猜你喜欢
      • 2021-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-06
      • 2018-05-08
      相关资源
      最近更新 更多