我正在尝试找出在全球范围内安装 StriderCD 的最佳方法。我通过启用全局的 nvm 分支安装了 node 和 npm ,并且所有路径都适用于其他构建,但它们都不需要像这样的后期安装。
我已经尝试了这两种方法,也只是在没有 sudo 的情况下以 root 身份安装,但在安装后步骤中,我总是在 bower 的 .config 和 .cache 文件夹上sudo npm install -g strider
遇到错误:EACCESS
> strider@1.6.6 postinstall /usr/local/lib/node_modules/strider
> bower install --allow-root && npm run build
/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/mkdirp/index.js:89
throw err0;
^
Error: EACCES, permission denied '/home/ubuntu/.config'
以 root 身份安装,root 对其自己的 $HOME 目录没有权限,这很奇怪,除非 bower 正在创建具有错误权限的目录和文件。谁能解释一下:
> strider@1.6.6 postinstall /usr/local/lib/node_modules/strider
> bower install --allow-root && npm run build
/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/configstore/index.js:56
throw err;
^
Error: EACCES, permission denied '/root/.config/configstore/bower-github.yml'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (evalmachine.<anonymous>:500:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:352:15)
at Object.create.all.get (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/configstore/index.js:34:29)
at Object.Configstore (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/configstore/index.js:27:44)
at readCachedConfig (/usr/local/lib/node_modules/strider/node_modules/bower/lib/config.js:22:23)
at defaultConfig (/usr/local/lib/node_modules/strider/node_modules/bower/lib/config.js:11:24)
at Object.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/bower/lib/index.js:40:32)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
使用 sudo 作为 ubuntu 用户并尝试过,chmod -R 777 $HOME/.config
我得到了同样的结果$HOME/.cache
!叹。
> strider@1.6.6 postinstall /usr/local/lib/node_modules/strider
> bower install --allow-root && npm run build
bower EACCES EACCES, permission denied '/home/ubuntu/.cache/bower/registry/bower.herokuapp.com/lookup'
Stack trace:
Error: EACCES, permission denied '/home/ubuntu/.cache/bower/registry/bower.herokuapp.com/lookup'
at Error (native)
at Object.fs.mkdirSync (fs.js:747:18)
at Function.sync (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/index.js:55:12)
at new Cache (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/bower-registry-client/lib/util/Cache.js:21:16)
at RegistryClient.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js:163:35)
at Array.forEach (native)
at RegistryClient.initCache (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js:150:34)
at RegistryClient._initCache (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/bower-registry-client/Client.js:62:27)
at new RegistryClient (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/bower-registry-client/Client.js:16:10)
at new PackageRepository (/usr/local/lib/node_modules/strider/node_modules/bower/lib/core/PackageRepository.js:17:28)
Console trace:
Error
at StandardRenderer.error (/usr/local/lib/node_modules/strider/node_modules/bower/lib/renderers/StandardRenderer.js:82:37)
at Logger.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/bower/bin/bower:110:22)
at Logger.emit (events.js:107:17)
at Logger.emit (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /usr/local/lib/node_modules/strider/node_modules/bower/lib/commands/index.js:45:20
at _rejected (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/q/q.js:844:24)
at /usr/local/lib/node_modules/strider/node_modules/bower/node_modules/q/q.js:870:30
at Promise.when (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/q/q.js:1122:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/strider/node_modules/bower/node_modules/q/q.js:788:41)
at /usr/local/lib/node_modules/strider/node_modules/bower/node_modules/q/q.js:556:49
System info:
Bower version: 1.4.1
Node version: 0.12.4
OS: Linux 3.13.0-48-generic x64
为什么bower$HOME/.config
在我使用--global
和sudo安装时坚持使用?有没有办法将其映射到不同的路径并使权限正确?当我su root -l
安装时,为什么 root 没有权限访问文件或在它自己的$HOME
和/或内部创建目录$HOME/.config
?非常混乱。
这是在全新更新的 14.04 LTS AWS 实例上。此错误的根本原因是什么,是我的设置导致问题还是 Bower 或 Strider 的配置错误?