2016-09-15 86 views
1

有點長,但我的數字包括儘可能多的信息,因爲我可以給我獲得解決方案的最佳機會。鮑爾埃爾卡皮坦安裝問題

我在OSX 10.11.6 El Capitan。

我通過Homebrew安裝了Hombrew和Node,npm和git。

我安裝了xcode和命令行工具。

$ brew -v 
    Homebrew 0.9.9 (git revision 09929; last commit 2016-09-15) 
    Homebrew/homebrew-core (git revision 08ce; last commit 2016-09-15) 

$ node -v 
    v6.5.0 

$ which node 
    /usr/local/bin/node 

$ npm -v 
    3.10.3 

$ which npm 
    /usr/local/bin/npm 

我似乎能夠安裝涼亭沒有問題:

$ npm install -g bower 
    /usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower 
    /usr/local/lib 
    └── [email protected] 

但後來我跑涼亭-v檢查我的安裝和我運行到一個問題:

$ bower -v 
    /usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:54 
      throw err; 
      ^

    Error: EACCES: permission denied, open '/Users/username/.config/configstore/bower-github.json' 
    You don't have access to this file. 

     at Error (native) 
     at Object.fs.openSync (fs.js:640:18) 
     at Object.fs.readFileSync (fs.js:508:33) 
     at Object.get (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:35:26) 
     at Object.Configstore (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:28:44) 
     at readCachedConfig (/usr/local/lib/node_modules/bower/lib/config.js:19:23) 
     at defaultConfig (/usr/local/lib/node_modules/bower/lib/config.js:11:12) 
     at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/index.js:16:32) 
     at Module._compile (module.js:556:32) 
     at Object.Module._extensions..js (module.js:565:10) 

所以我運行這些命令:

$ sudo chown -R $USER:$GROUP ~/.npm 
$ sudo chown -R $USER:$GROUP ~/.config 

然後我跑涼亭再次-V:

$ bower -v 
    1.7.9 

它看起來進行排序,直到我嘗試並安裝我的第一包:

$ bower install bootstrap --save-dev 
    bower bootstrap#*   not-cached    
    https://github.com/twbs/bootstrap.git#* 
    bower bootstrap#*    resolve  https://github.com/twbs/bootstrap.git#* 
    bower bootstrap#*    checkout v3.3.7 
    bower bootstrap#*    progress Receiving objects: 19% (78/409) 
    bower bootstrap#*    progress Receiving objects: 46% (189/409), 708.00 KiB | 703.00 KiB/s 
    bower bootstrap#*    progress Receiving objects: 49% (201/409), 1.73 MiB | 883.00 KiB/s 
    bower bootstrap#*    EACCES EACCES: permission denied, open '/Users/username/.cache/bower/packages/478ab1d28ba78f550601bf536eea62f5-3.3.7.lock' 

    Stack trace: 
    Error: EACCES: permission denied, open '/Users/username/.cache/bower/packages/478ab1d28ba78f550601bf536eea62f5-3.3.7.lock' 
at Error (native) 

    Console trace: 
    Error 
     at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:81:37) 
     at Logger.<anonymous> (/usr/local/lib/node_modules/bower/lib/bin/bower.js:110:26) 
     at emitOne (events.js:96:13) 
     at Logger.emit (events.js:188:7) 
     at Logger.emit (/usr/local/lib/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39) 
     at /usr/local/lib/node_modules/bower/lib/commands/index.js:48:20 
     at _rejected (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:844:24) 
     at /usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:870:30 
     at Promise.when (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:1122:31) 
     at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:788:41) 
    System info: 
    Bower version: 1.7.9 
    Node version: 6.5.0 
    OS: Darwin 15.6.0 x64 

這是我卡住。任何幫助解決這個問題將不勝感激。

+0

嗯,沒有人有任何想法? – nmisr

回答

0

我也在使用El Capitan。我必須刪除目錄才能使其工作。

sudo rm -rf ~/.config/

嘗試所有的選項,比如chown和CHMOD後,唯一的方法是刪除目錄。但我不知道這是否是最好的選擇。

0
sudo bower install --allow-root bootstrap 
相關問題