Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: Cannot create property 'lastUpdateCheck' on string 'lastUpdateCheck 1599160669280'

So I'm getting this error when I try to do a yarn install. I can yarn start without issue but i'm not sure if it's causing an issue behind the scenes so i'd like to resolve it.

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

i've tried deleting my yarn.lock and basically every file i could find that had yarn in it and reinstalling. I've tried installing yarn through yvm instead of brew. None of these things have had any affect.

Any help is greatly appreciated.

like image 438
user1218336 Avatar asked Dec 10 '25 05:12

user1218336


2 Answers

Have you tried removing the ~/.yarnrc file? I had a corrupted .yarnrc file that was preventing me from installing.

Running this should remove your yarnrc.

rm ~/.yarnrc

Experienced this issue with WSL but it should be applicable in other cases.

I also submitted and later resolved an issue 8469

like image 162
fengelhardt Avatar answered Dec 12 '25 18:12

fengelhardt


I had a similar issue while I was trying to set up a Chakra-UI project with Vite and Reactjs but mine was throwing a different error code - MODULE_NOT_FOUND. I noticed this when I ran the command yarn to install dependencies. When I ran yarn --version to be sure if I still had yarn enabled the error was still there, even by just running yarn it was still throwing the same error code. I enabled yarn using corepack enable and updated to the latest version with the command yarn set version stable and yarn install - yarn docs, here: https://yarnpkg.com/getting-started/install . I noticed this problem was resolved when I deleted a hidden yarn configuration file called .yarnrc that lives in my root directory; where I performed the yarn installation. If you're on Linux the command ls -a can be used to view hidden files in a directory. What I don't understand is why that .yarnrc file was preventing me from using yarn? I had to delete it before yarn started working. When run yarn again; another new .yarnrc file was created but not causing any issues. Maybe the old one was corrupted. See the image below for the error. yarn module_error screenshotThank you.

like image 44
Dae-mon Avatar answered Dec 12 '25 18:12

Dae-mon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!