2

I am fetching requirejs with the command bower install requirejs ---save and this is resulting in a requirejs folder being added to my components folder, but within it the require.js file (and all other files) is not there. The only file added is a .bower.json file. I assume that I must be misunderstanding something. When I grab other packages through bower (like angular and angularAMD) I get the javascript content, but not for require. What gives?

bower.json file below

{
  "dependencies": {
    "angular": "latest",
    "requirejs": "latest",
    "angularAMD": "latest"
  },
  "resolutions": {
    "angular": "1.5.8"
  }
}

and .bowerrc

{
    "directory": "bower_components/lib"
}

Also of note is that I installed bower through nuget, which added a .bin folder to the project with the following files in it bower.cmd, git.cmd, and node.cmd. I believe these are mini instanced of git and node to use for fetching, I assume the problem lies somewhere with these as they are the only real difference between intellij and visual studio.

Josh
  • 1,648
  • 8
  • 27
  • 58
  • Which system (Windows, MacOS, Linux)? Show Your `.bowerrc` and `bower.json` files – Tomasz Jakub Rup Aug 02 '16 at 06:48
  • I just did `bower install requirejs --save` and the correct files were installed. I cannot reproduce what you report here. – Louis Aug 02 '16 at 09:52
  • I have done some more testing, everything works fine if I create a project in intellij, but when I use Visual Studio 2015 on Windows that is where I see this happening. Same bower.json file in both, so this is related to windows and visual studio somehow. – Josh Aug 02 '16 at 15:21
  • See updated question for more details about the difference – Josh Aug 02 '16 at 15:33
  • Had the same issue and it was because of the folder `bower_components` was not in the root folder of the project. Remove `.bowerrc` and try `bower install requirejs` in the root of project folder. If this works please report bug and put the bug report link in the comments, thanks. – Gert Cuykens Mar 07 '17 at 00:33

1 Answers1

0

Try running the command 'bower -v' in your terminal and see the version of your bower. I have 1.8.0 installed in my system and requirejs does get installed correctly for me with the require.js file inside the requirejs folder installed by bower. Although, I do remember facing such issues at some other point in time for another package which I solved it by cleaning my bower cache, you can do that by running the command 'bower cache clean' and while you are at it you may also try to clear your temp folder by which is by pressing 'windows key + R' typing %temp% in the search and then press enter, delete whatever can be deleted and, restart your terminal and go over the installation again.

The process for clearing the temp folder is for windows, you may want to look for another way to clear it if you are not on a windows machine.

Thanks.

Saurabh Pati
  • 795
  • 6
  • 14