简体   繁体   English

Bower初始化命令错误

[英]Bower init command error

I am trying out Google Polymer. 我正在尝试Google Polymer。 Successfully installed node.js and as you can see below npm and Bower are installed. 成功安装了node.js,如下所示,已安装了npm和Bower。 However, when typing "bower init cmd" it gives me the following error(s): What am I doing wrong and how to best solve this problem? 但是,键入“ bower init cmd”时,出现以下错误:我做错了什么以及如何最好地解决此问题? Running Mac OS X (Mav) Thanks in advance. 运行Mac OS X(Mav)预先感谢。

shukhratnegmatov:Polymer shukhratnegmatov$ node -v
v0.10.30
shukhratnegmatov:Polymer shukhratnegmatov$ npm -v
1.4.21
shukhratnegmatov:Polymer shukhratnegmatov$ bower -v
1.3.9
shukhratnegmatov:Polymer shukhratnegmatov$ bower init

Error: EACCES, permission denied '/Users/shukhratnegmatov/.config/configstore'
    at Object.fs.mkdirSync (fs.js:647:18)
    at Function.sync (/usr/local/lib/node_modules/bower/node_modules/mkdirp/index.js:70:13)
    at Object.create.all.get (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/configstore.js:40:13)
    at Object.Configstore (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/configstore.js:26:44)
    at new Insight (/usr/local/lib/node_modules/bower/node_modules/insight/lib/insight.js:26:34)
    at Object.setup (/usr/local/lib/node_modules/bower/lib/util/analytics.js:18:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:72:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
shukhratnegmatov:Polymer shukhratnegmatov$ 

The solution to this, if you have similar situation like me, is that the configstore might be removed by one of your program for some reason. 如果您遇到类似我的情况,此问题的解决方案是,由于某种原因,您的某个程序可能会删除configstore。

In this case you can go to open your terminal and type: 在这种情况下,您可以打开终端并输入:

open Users/[your username]/.config 打开用户/ [您的用户名] /。config

[your username] should be your username. [您的用户名]应该是您的用户名。 I assume it's shukhratnegmatov. 我认为是shukhratnegmatov。

And then you create a folder called configstore! 然后创建一个名为configstore的文件夹!

Done. 完成。

我遇到了同样的问题,只需替换“用户名”即可

    $ sudo chown username /Users/username/.config/configstore/insight-bower.yml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM