`bower`抛出错误安装`jquery`

时间:2015-03-10 07:20:06

标签: jquery node.js powershell bower bower-install

使用Windows PowerShell我正在创建.bowerrc文件并尝试使用jquery安装bower。我出现了错误。我不明白我在这里做错了..

任何人都能找到我吗?

这是我的步骤:

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>

1 个答案:

答案 0 :(得分:0)

我将.bowerrc路径更改为{"directory":"public/lib"}这个。有用。看来,它要求目录应该要求明星public ..?

谢谢大家。