aspyatkin / yarn-cookbook

Chef cookbook to install Yarn package manager
https://supermarket.chef.io/cookbooks/yarn
MIT License
5 stars 6 forks source link

cmdtest gets installed instead of yarn #7

Open zeroedin opened 5 years ago

zeroedin commented 5 years ago

This is not directly related to this cookbook rather to Ubuntu and the yarn package specifically but figure I would mention it here.

Referencing Issues found https://github.com/yarnpkg/yarn/issues/3189 and https://github.com/Joystream/helpdesk/issues/16

cmdtest is installed instead of yarn on AWS Ubuntu 18.04

2019-06-10T10:16:36-04:00] INFO: Processing yarn_install[/srv/www/xxxxx/releases/20190610141627] action run (/srv/www/lists/releases/20190610141627/deploy/before_restart.rb line 42)
[2019-06-10T10:16:36-04:00] INFO: Processing execute[execute yarn install at `/srv/www/xxxxx/releases/20190610141627`] action run (/var/chef/runs/ecec4f1c-a306-4104-a303-d51caab053cc/local-mode-cache/cache/cookbooks/yarn/resources/install.rb line 18)

================================================================================
Error executing action `run` on resource 'execute[execute yarn install at `/srv/www/xxxxx/releases/20190610141627`]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of yarn install ----
STDOUT: Parsing scenario file install
STDERR: ERROR: [Errno 2] No such file or directory: 'install'
---- End output of yarn install ----
Ran yarn install returned 1

Following up the recipe with an attempt to install yarn via sudo apt-get install yarn yields:

sudo apt-get install yarn
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'cmdtest' instead of 'yarn'
The following additional packages will be installed:
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-chardet python-cliapp python-markdown python-minimal python-pkg-resources python-pygments
  python-ttystatus python-yaml python2.7 python2.7-minimal
Suggested packages:
  python-doc python-tk python-xdg python-markdown-doc python-setuptools ttf-bitstream-vera python2.7-doc binfmt-support
The following NEW packages will be installed:
  cmdtest libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-chardet python-cliapp python-markdown python-minimal python-pkg-resources python-pygments
  python-ttystatus python-yaml python2.7 python2.7-minimal
0 upgraded, 15 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/4996 kB of archives.
After this operation, 22.2 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Manually installing yarn without the recipe via the following commands seemed to work to resolve:

sudo apt remove cmdtest 
sudo apt remove yarn && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 
sudo apt-get update && sudo apt-get install yarn

Adding the following to the key instead of the default .gpg url for node['yarn']['package']['repository']['key'] seemed to be the fix for me

"yarn": {
  "package": {
    "repository": {
      "key": "23E7166788B63E1E"
    }
  }
}
ritu9898 commented 4 years ago

sudo apt remove cmdtest sudo apt remove yarn && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn

This didn't work for me until I added this one line.

sudo apt install gcc g++ make

mesozoic-technology commented 3 years ago
ubuntu@ip-172-31-24-108:~$ sudo apt remove yarn && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'cmdtest' instead of 'yarn'
0 upgraded, 0 newly installed, 0 to remove and 75 not upgraded.
gpg: [don't know]: partial length invalid for packet type 63
gpg: read_block: read error: Invalid packet
gpg: import from '-' failed: Invalid keyring