0

Using the Windows PowerShell I am creating a .bowerrc file and trying to install the jquery using bower. i am turn up with error. i am not understand the wrong what i do here..

any one figure out me please?

here is my steps:

PS D:\Tutts\Projects\Scratch> echo '{"directory":"lib/scripts/"}'>.bowerrc
PS D:\Tutts\Projects\Scratch> bower install jquery -save

C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:55
        throw error;
              ^
Error: Unable to parse D:\Tutts\Projects\Scratch\.bowerrc: Unexpected token �
    at parse (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:48:2
1)
    at json (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:70:12
)
    at rc (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:31:9)
    at Config.load (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\Config.js
:14:20)
    at Function.Config.read (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\
Config.js:49:19)
    at readCachedConfig (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\lib\config.js:21:51)
    at defaultConfig (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\lib\config.js:11:24)
    at Object.<anonymous> (C:\Users\Mohamed.Arif\AppData\Roaming\npm\node_modules\bower\lib\index.js:40:32)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
PS D:\Tutts\Projects\Scratch>
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247
  • Read the error message, it tells you everything you need to know: `Error: Unable to parse D:\Tutts\Projects\Scratch\.bowerrc: Unexpected token ∩┐╜` Looks like you've got some characters in your `.bowerrc` file that bower can't parse. – Kev Mar 10 '15 at 07:22
  • yes, understand. but from that i am not able to understand what i need to change in file or something else.. can you give a clue? – 3gwebtrain Mar 10 '15 at 07:24
  • Basically when using `echo` (which is an alias of `Write-Output`) it writes a UTF-16 Byte Order Mark at the start of the file. bower obviously isn't happy about this. See this answer for ways around this and to force ASCII output: http://stackoverflow.com/questions/8163922/echo-string-file-in-windows-powershell-appends-non-printable-character-to-th – Kev Mar 10 '15 at 07:41

1 Answers1

0

I changed my .bowerrc path to {"directory":"public/lib"} this. It works. it seems that, it requires the directory should require to star at public..?

Thanks for all.

vonPryz
  • 22,996
  • 7
  • 54
  • 65
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247