Yarn: All yarn commands fail with "Cannot create property '_registry' on number '6'" error

Created on 3 Oct 2017  路  4Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
bug

What is the current behavior?
After installing yarn via npm, all commands to yarn report the error:

$ yarn init v1.1.0
error An unexpected error occurred: "Cannot create property '_registry' on number '6'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\alarned\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/init for documentation about this command.

If the current behavior is a bug, please provide the steps to reproduce.

Install yarn, run commands:

$ npm install -g yarn
$ yarn init
or
$ yarn add react react-dom react-scripts

What is the expected behavior?
I expect a project to be initiated

Please mention your node.js, yarn and operating system version.
NodeJS: v6.11.3
Yarn: 1.1.0
Windows 8.1

Contents of yarn-error.log

Arguments:
  C:\Program Files\nodejs\node.exe C:\Users\alarned\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js init

PATH:
  C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\ProgramData\Lenovo\ReadyApps;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\pgmodeler;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\nodejs;C:\Program Files (x86)\GNU\GnuPG\pub;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools;C:\Program Files (x86)\Skype\Phone;C:\Users\alarned\bin\maven\bin;C:\Users\alarned\bin\apache-ant-1.9.2\bin;C:\Users\alarned\bin\emacs-24\bin;C:\Python27;C:\Users\alarned\.cask\bin;C:\Program Files\PostgreSQL\9.4\bin;C:\Users\alarned\cloverETL.rel-4-0-4\cloverETL\bin;C:\Users\alarned\bin\fciv;C:\Program Files (x86)\Graphviz-2.28\release\bin;C:\Program Files (x86)\Google\google_appengine;C:\Users\alarned\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\alarned\AppData\Roaming\npm

Yarn version:
  1.1.0

Node version:
  6.11.3

Platform:
  win32 x64

npm manifest:
  6.0

yarn manifest:
  No manifest

Lockfile:
  No lockfile

Trace:
  TypeError: Cannot create property '_registry' on number '6'
      at C:\Users\alarned\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:53695:24
      at next (native)
      at step (C:\Users\alarned\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:92:30)
      at C:\Users\alarned\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:103:13

Most helpful comment

I had a similar issue which was caused by a malformed ~/.npmrc file. Deleted it and populated it with the correct details (in my case given to me by the company) and yarn worked fine again.

There's a list of other places where the npmrc file would be here https://docs.npmjs.com/files/npmrc

All 4 comments

Check your yarn configurations by typing

yarn config list

See if there is any wrongly typed property/value

On _all_ yarn commands I get the error reported above. I just re-installed yarn globally, and running yarn config list reports the same error

$ yarn config list
yarn config v1.3.2
error An unexpected error occurred: "Cannot create property '_registry' on number '6'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\alarned\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/init for documentation about this command.

I had a similar issue which was caused by a malformed ~/.npmrc file. Deleted it and populated it with the correct details (in my case given to me by the company) and yarn worked fine again.

There's a list of other places where the npmrc file would be here https://docs.npmjs.com/files/npmrc

@jaywick you save my day

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MunifTanjim picture MunifTanjim  路  3Comments

torifat picture torifat  路  3Comments

FLGMwt picture FLGMwt  路  3Comments

davidmaxwaterman picture davidmaxwaterman  路  3Comments

danez picture danez  路  3Comments