Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WSL] cannot create property lastUpdateCheck on string 'lastUpdateCheck...' #8469

Closed
FrederickEngelhardt opened this issue Nov 20, 2020 · 2 comments

Comments

@FrederickEngelhardt
Copy link

Bug description

On WSL 2 using nvm I am unable to utilize yarn to do anything because it will exit out with a type error with attempting to create a property on lastUpdateCheck which already exists.

Command

# install yarn via brew or ubuntu tutorial
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
# Using NVM so exclude node
sudo apt update && sudo apt install --no-install-recommends yarn

# alternative
npm i -g yarn

What is the current behavior?
Whenever I run yarn install for a project I get the following error in my terminal

# this will use yarn install instead of npm if yarn is added
npx create-react-app my-test-app
# fails and rolls back with this message
TypeError: Cannot create property 'lastUpdateCheck' on string 'lastUpdateCheck 1603009736399'
    at YarnRegistry.<anonymous> (/usr/share/yarn/lib/cli.js:96344:30)
    at Generator.next (<anonymous>)
    at step (/usr/share/yarn/lib/cli.js:310:30)
    at /usr/share/yarn/lib/cli.js:328:14
    at new Promise (<anonymous>)
    at new F (/usr/share/yarn/lib/cli.js:5301:28)
    at YarnRegistry.<anonymous> (/usr/share/yarn/lib/cli.js:307:12)
    at YarnRegistry.saveHomeConfig (/usr/share/yarn/lib/cli.js:96351:20)
    at Add.<anonymous> (/usr/share/yarn/lib/cli.js:7930:35)
    at Generator.next (<anonymous>)

This occurs in a previous yarn repo as well. Example you have a react-app already created and run yarn to install the dependencies.

yarn
TypeError: Cannot create property 'lastUpdateCheck' on string 'lastUpdateCheck 1603009736399'
    at YarnRegistry.<anonymous> (/usr/share/yarn/lib/cli.js:96344:30)
    at Generator.next (<anonymous>)
    at step (/usr/share/yarn/lib/cli.js:310:30)
    at /usr/share/yarn/lib/cli.js:328:14
    at new Promise (<anonymous>)
    at new F (/usr/share/yarn/lib/cli.js:5301:28)
    at YarnRegistry.<anonymous> (/usr/share/yarn/lib/cli.js:307:12)
    at YarnRegistry.saveHomeConfig (/usr/share/yarn/lib/cli.js:96351:20)
    at Install.<anonymous> (/usr/share/yarn/lib/cli.js:7930:35)
    at Generator.next (<anonymous>)

What is the expected behavior?
There should be no lastUpdateCheck error. Yarn is not useable right now.

  1. Anyone got a workaround for this issue?
  2. Is there a long term solution?

Steps to Reproduce

  1. Use Ubuntu on WSL2 (windows computer)
  2. Install NVM
  3. npx create-react-app my-wsl-test
  4. The above command should fail

Environment

  • Node Version: 14.14.0
  • Yarn v1 Version: 1.22.5
  • OS and version: WSL 2 Linux 4.19.104-microsoft-standard
@FrederickEngelhardt
Copy link
Author

Resolved by removing the ~/.yarnrc file which contained a lastUpdateCheck string which prevented the install.

Ran this command

rm ~/.yarnrc

No longer have an issue installing or using yarn commands.

Also similar to #5592

@MikhailBobrov
Copy link

thanks, it help me

@yarnpkg yarnpkg locked as resolved and limited conversation to collaborators Oct 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants