简体   繁体   中英

Running into errors while installing Yarn

I'm trying to install yarn on a new machine and after I enter brew install yarn this is what my command line spits out:

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

Thanks ahead of time!

I have faced below issue while installing webpack in following configuration

Ubuntu 14.04

webpacker (3.0.2)

Rails 5.1.4

Ruby 2.3.1p112

I got below errors:

Webpacker requires Node.js >= 6.0.0 and you are using 0.10.25 Please upgrade Node.js https://nodejs.org/en/download/

I have fixed my issue following steps:

Steps to install Vuejs via webpack in a rails app

The gem Webpacker solves lots of questions on how to integrate the frontend into the Rails app

Webpack prerequisites: Ruby 2.2+, Rails 4.2+, Node.js 6.0.0+ and Yarn 0.25.2+

( Note:- Following steps for ubuntu 14.04 users)

Step 1: Install Nodejs

  • sudo apt-get update
  • sudo apt-get install nodejs

Step 2: Install Yarn

Step 3: Add webpack gem into your rails app

  • gem 'webpacker', '~> 3.0'

then bundle install ,

Step 4: Install Vue in rails app

  • rails webpacker:install:vue

Way to install vuejs packages

For ex:

npm install vue-strap

Now you installed vue-strap in your rails app,

Check your packages added or not in your rails app following step:

cd /your_projec_name/node_modules

It seems that the permissions inside the Homebrew directory have not set correctly. You can either do something like this:

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

or

use npm to install yarn:

brew uninstall yarn

npm install yarn -g

yarn global upgrade yarn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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