title: yarn run error : Command failed with exit code 1
body: <p>I was trying to follow this <a href="https://lorisleiva.com/create-a-solana-dapp-from-scratch/getting-started-with-solana-and-anchor#:%7E:text=build%0Aanchor%20deploy-,anchor%20run%20test,-Well%2C%20it%20turns" rel="nofollow noreferrer">tutorial</a><br />
  This is a tutorial on Solana program dev using anchor and the error rises from using yarn on ubuntu 20.0 i guess
  and I got this long error I can't understand
  All the help is appreciated</p>
  <pre><code>yarn run v1.22.17
  warning package.json: No license field
  $ /home/sadaf/code/solana-twitter/node_modules/.bin/ts-mocha -p ./tsconfig.json -t 1000000 'tests/**/*.ts'
  
  ReferenceError: TextEncoder is not defined
      at Function.fromSecretKey (/home/sadaf/code/solana-twitter/node_modules/@solana/web3.js/src/keypair.ts:66:23)
      at Function.local (/home/sadaf/code/solana-twitter/node_modules/@project-serum/anchor/src/nodewallet.ts:13:27)
      at Function.env (/home/sadaf/code/solana-twitter/node_modules/@project-serum/anchor/src/provider.ts:79:31)
      at Suite.describe (/home/sadaf/code/solana-twitter/tests/solana-twitter.ts:7:38)
      at Object.create (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/interfaces/common.js:148:19)
      at context.describe.context.context (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/interfaces/bdd.js:42:27)
      at Object.&lt;anonymous&gt; (/home/sadaf/code/solana-twitter/tests/solana-twitter.ts:5:1)
      at Module._compile (internal/modules/cjs/loader.js:778:30)
      at Module.m._compile (/home/sadaf/code/solana-twitter/node_modules/ts-node/src/index.ts:439:23)
      at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
      at Object.require.extensions.(anonymous function) [as .ts] (/home/sadaf/code/solana-twitter/node_modules/ts-node/src/index.ts:442:12)
      at Module.load (internal/modules/cjs/loader.js:653:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
      at Function.Module._load (internal/modules/cjs/loader.js:585:3)
      at Module.require (internal/modules/cjs/loader.js:692:17)
      at require (internal/modules/cjs/helpers.js:25:18)
      at Object.implementationOfRequireOrImportForUnstableEsm [as requireOrImport] (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/nodejs/esm-utils.js:116:12)
      at Object.exports.loadFilesAsync (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/nodejs/esm-utils.js:103:34)
      at process._tickCallback (internal/process/next_tick.js:68:7)
      at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
      at startup (internal/bootstrap/node.js:283:19)
      at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
  error Command failed with exit code 1.
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  </code></pre>