bower is not recognised as an internal or external command

后端 未结 13 1328
野趣味
野趣味 2020-12-05 03:57

I have successfully installed nodejs, and express framework, however I downloaded bower via

npm install -g bower

which ran successfully.

13条回答
  •  萌比男神i
    2020-12-05 04:36

    Although we have already good answers here, I will give an extra hint. Check if you have a .npmrc file inside the folder /Users/YOUR_USER/. When this problem happened to me, my .npmrc file had this content:

    http_proxy=http://:@:
    https_proxy=http://:@:
    proxy=http://:@:/
    https-proxy=http://:@:
    prefix = "D:\\\\nodejs"
    cache = "D:\\\\nodejs\\npm-cache"
    

    Due to prefix and cache lines, the bower was being installed inside the folder specified in prefix.

    SOLUTION: I deleted prefix and cache lines. The I installed bower again with the following command:

    npm install -g bower
    

    After that, my bower became global as expected.

提交回复
热议问题