33

This MEAN-stack tutorial describes using Bower to install AngularJS in your public folder. One of the steps describes creating a file called ".bowerrc" in your test-app folder. However, Windows won't let you create a file without a name. How do I accomplish this on a Windows system?

Dominic Cronin
  • 6,062
  • 2
  • 23
  • 56
WEFX
  • 8,298
  • 8
  • 66
  • 102
  • 1
    http://stackoverflow.com/questions/5004633/how-to-manually-create-a-file-with-a-dot-prefix-in-windows-for-example-htacce – Lim H. Nov 25 '13 at 20:15

4 Answers4

52

on the command line (make sure to cd into your working directory), issue this command:

touch .bowerrc

This will also work for other files common to webdev like .htaccess and .gitignore

Note: If you haven't installed git bash for windows, you may not have support for the touch command. In that case (as mentioned in one of the comments here), the easiest way to accomplish this is via the cli with:

echo "" > .bowerrc
Brian Vanderbusch
  • 3,313
  • 5
  • 31
  • 43
  • 2
    @JeffHubbard - I had already installed the Git Bash tool described in that tutorial, so I was able to use 'touch'. – WEFX Nov 25 '13 at 20:29
  • Regarding touch ... there's another question here on SO describing a simple (MSDN-documented!) way to simulate touch with Windows. Look for `copy /b filename.ext +,,` here: http://stackoverflow.com/questions/51435/windows-version-of-the-unix-touch-command – JensG Nov 25 '13 at 20:37
  • 6
    Just for the sake of completeness, `echo "" > .bowerrc` from cmd also works for me (Windows 8). – Nikos Paraskevopoulos Nov 25 '13 at 20:37
  • @JeffHubbard, that's a good point, but his tutorial installed the git module, so it was relevant here. If you're using bower, chances are great your cli has support for `touch` – Brian Vanderbusch Nov 26 '13 at 03:00
31

To create a file that starts with a "." in Windows, you just need to add a trailing ".".

So, simply name your file ".bowerrc." instead of ".bowerrc".

See https://superuser.com/questions/64471/create-rename-a-file-folder-that-begins-with-a-dot-in-windows for more information and more detailed solution if this doesn't work for you.

Community
  • 1
  • 1
PeteK68
  • 461
  • 5
  • 9
  • 5
    This should be the accepted answer, it doesn't depends on cmd or any other tools apart from explorer – GGG May 22 '16 at 22:45
6

Another way to accomplish this is through Notepad++.

  • Create the file in Notepad++
  • Set the encoding to "Encoding in ANSI" (click "Encoding" in the menu bar)
  • Save the file as .bowerrc (change the "Save as type:" to . which is one list item up from *.txt)
VtoCorleone
  • 16,813
  • 5
  • 37
  • 51
5

Simply rename the file you created:

C:\project> ren bowerrc .bowerrc
Supersharp
  • 29,002
  • 9
  • 92
  • 134