【问题标题】:Running into errors while installing Yarn安装 Yarn 时遇到错误
【发布时间】:2017-12-12 22:46:12
【问题描述】:

我正在尝试在一台新机器上安装 yarn,在我输入 brew install yarn 后,我的命令行输出如下:

touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied
touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-
apache/.git/FETCH_HEAD: Permission denied
touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-
core/.git/FETCH_HEAD: Permission denied
touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-
dupes/.git/FETCH_HEAD: Permission denied
touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-
php/.git/FETCH_HEAD: Permission denied
touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-
versions/.git/FETCH_HEAD: Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': 
Permission denied
error: could not lock config file .git/config: Permission denied
==> Installing dependencies for yarn: icu4c, node
==> Installing yarn dependency: icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-
60.1.high_sierra.bottle.t######################################################################## 100.0%
==> Pouring icu4c-60.1.high_sierra.bottle.tar.gz
Error: Permission denied @ unlink_internal - /usr/local/opt/icu4c

提前谢谢!

【问题讨论】:

    标签: ruby-on-rails node.js npm yarnpkg


    【解决方案1】:

    我在以下配置中安装 webpack 时遇到了以下问题

    Ubuntu 14.04

    webpacker (3.0.2)

    Rails 5.1.4

    红宝石 2.3.1p112

    我收到以下错误:

    Webpacker 需要 Node.js >= 6.0.0 并且您使用的是 0.10.25 请 升级Node.jshttps://nodejs.org/en/download/

    我已按照以下步骤解决了我的问题:

    在 Rails 应用中通过 webpack 安装 Vuejs 的步骤

    gem Webpacker 解决了很多关于如何将前端集成到 Rails 应用程序中的问题

    Webpack 先决条件: Ruby 2.2+、Rails 4.2+、Node.js 6.0.0+ 和 Yarn 0.25.2+

    注意:-以下步骤适用于 ubuntu 14.04 用户)

    第 1 步: 安装 Nodejs

    • sudo apt-get 更新
    • sudo apt-get install nodejs

    第 2 步:安装 Yarn

    第 3 步:将 webpack gem 添加到您的 Rails 应用中

    • gem 'webpacker', '~> 3.0'

    然后捆绑安装

    第 4 步: 在 Rails 应用中安装 Vue

    • rails webpacker:install:vue

    vuejs 包的安装方式

    例如:

    npm install vue-strap

    现在您在 Rails 应用中安装了 vue-strap,

    按照以下步骤检查您在 Rails 应用中添加或未添加的包:

    cd /your_projec_name/node_modules

    【讨论】:

      【解决方案2】:

      Homebrew 目录中的权限似乎没有正确设置。 你可以这样做:

      sudo chown -R $(whoami) /usr/local

      使用npm安装yarn:

      brew卸载纱线

      npm install yarn -g

      yarn 全局升级yarn

      【讨论】:

        猜你喜欢
        • 2018-08-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-08
        相关资源
        最近更新 更多