bower is not recognised as an internal or external command

后端 未结 13 1256
野趣味
野趣味 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条回答
  • 2020-12-05 04:36

    Sometimes even after Scott's steps do not resolve the problem. Open the command prompt in admin mode. This resolves the problem

    0 讨论(0)
  • 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://<LOGIN>:<PASSWORD>@<PROXY>:<PORT>
    https_proxy=http://<LOGIN>:<PASSWORD>@<PROXY>:<PORT>
    proxy=http://<LOGIN>:<PASSWORD>@<PROXY>:<PORT>/
    https-proxy=http://<LOGIN>:<PASSWORD>@<PROXY>:<PORT>
    prefix = "D:\\<SOME_DIR>\\nodejs"
    cache = "D:\\<SOME_DIR>\\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.

    0 讨论(0)
  • 2020-12-05 04:37

    I have faced the same problem. I have solved by using the following steps

    1. Go to Control Panel\System and Security\System and click Advanced system settings

    2. In that you can see Environment Variables in Advanced tab. Now ,Environment Variables Window opens.

    3. Select the path and click Edit button and add C:\Users\\AppData\Roaming\npm . Click ok to save.

    Note : before adding path add a colon(;) in front of that path if not there for previous one

    Now you can able to install bower . Hope it helps.

    0 讨论(0)
  • 2020-12-05 04:38

    I just wanted to add update to windows 10 users, I found that typing bower into the search bar will return "run command" option. Execute that and it will then prompt if bower can submit info, return a y/n and you should be good to go.

    0 讨论(0)
  • 2020-12-05 04:41
    1. Press Window+R
    2. %appdata% Press Enter Key
    3. C:\Users\xyz\AppData\Roaming\npm
    4. Double Click bower.cmd icon
    5. Press Shift Right Mouse Click Then Selec Open Command Window Here
    6. Paste bower install MDBootstrap

    SCREENSHOT

    0 讨论(0)
  • 2020-12-05 04:49

    I am using Windows 7 as well and had this problem too.

    After I took the steps outlined in Scott Marchant's answer, bower worked.

    Find the location of your npm global binaries: npm config get prefix. This path may look something like C:\Users\username\AppData\Roaming\npm. Add the path from step 1 to your Path.

    Open the Windows Control Panel, search for environment, then click on either edit environment variables for your account, or Edit the system environment variables`.

    Find the variable named Path or PATH, or create one if it doesn't exist.

    Paste the path from step 1 here (; delimited).

    You may need to restart your command prompt window.

    You should now be able to enter bower commands.

    0 讨论(0)
提交回复
热议问题