1

I tried a lot, but my projects don't run with yarn, while already worked(made with create-react-app).

I tried: yarn install - npm install --global yarn - npm update --global yarn - yarn version apply and ect.

when I run yarn start then:

enter image description here

Edit1: When I create a new project(with create-react-app), not occur any error. It gives an error only for the previous projects.

I already did yarn install for those directories, and yarn start worked. So run yarn install doesn't fix that. Although when I run run install again, it gives this error:

enter image description here

Edit2: When I remove node_modules and .yarn and yarn.lock, then run yarn install and thenyarn start, it gives another error:

enter image description here

Arman Ebrahimi
  • 1,727
  • 1
  • 3
  • 13

1 Answers1

1

You should run

yarn install

before running any npm script (yarn start). It works when you use create-react-app because it installs dependencies by itself.

About the digital envelope error, You get this error because of the NodeJS version (most likely). If you use the latest LTS downgrade to the previous LTS version. You can read more here: ystackoverflow.com/questions/69692842/… Let me know how that goes –

Tasos
  • 1,723
  • 10
  • 17
  • Thanks. But I did it already. So installed dependencies. I updated the question. – Arman Ebrahimi May 10 '22 at 12:53
  • Can you try deleting the `node_modules` folder and running yarn install && yarn start again? – Tasos May 11 '22 at 11:12
  • Thanks again. Only `node_modules`? (how about `.yarn or yarn.lock?`). I deleted it now, but it gives the same error again. – Arman Ebrahimi May 12 '22 at 05:07
  • 1
    You get this error because of the NodeJS version (most likely). If you use the latest LTS downgrade to the previous LTS version. You can read more here: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported Let me know how that goes – Tasos May 12 '22 at 10:07
  • Thanks a lot. Fixed with version(16.15.0). Please add your comment to your answer so I can accept it :) – Arman Ebrahimi May 16 '22 at 05:41
  • Done, happy to help @ArmanEbrahimi – Tasos May 16 '22 at 11:55