Yarn is not recognized as an internal or external command

(Original URL)

Describe the bug

Project does not start due to tsc not being present.

To Reproduce

  1. Fork repo
  2. Run yarn
  3. Run yarn start

Expected behavior

Success output.

Screenshots

Yarn is not recognized as an internal or external command

Desktop (please complete the following information):

  • OS: Windows 10 Home
  • Browser N/A
  • Version No version present in intuit/design-systems-cli

Comments (21)

+2

You could just add the engines section to the package.json that will show an error to the users if they are using a different version and will suggest which one should be used

"engines": {
    "node": ">=10.18.1"
}

Along with that a badge with the expected node version can be added to the README.

+1

@jasonrundell I can see the following line in your terminal output:

Yarn is not recognized as an internal or external command
that mean that you’re getting an error installing the modules, you should upgrade your node version to at least 10.18.1, and that could be the minimum required version, this could be added to the readme.

I feel that if you upgrade you will not have any problem again.

+1

Maybe a windows thing? Potentially a npm/node versioning issue? I just tried a clean clone of the repo and did yarn and yarn start without issue – but i’m on a macbook. If you’re able to diagnose the problem, i’d be curious to know what the underlying issue is.

Upgraded to node version v12.18.4 and yarn install finished node_modules download.

yarn start looks to be working correctly…

[4:48:11 PM] Starting compilation in watch mode...

[4:49:22 PM] Found 0 errors. Watching for file changes.

Ok, so should the README declare the minimum version of node to be 10.18.1?

I don’t have typescript installed locally, I’m not seeing the error, and it shouldn’t be a pre-requisite, one possible solution could be rather that using the tsc alone, you can use the path to local executable ./node_modules/.bin/tsc. I’m using zsh as my shell interpreter in Mac, Linux and Windows

I get no node_modules after running yarn or yarn install

That’s exactly the reason because tsc is not working for you.

I’m using , and , everything working without any issue

I get no node_modules after running yarn or yarn install

That seems like the underlying problem. Are you on yarn-v1 or yarn-v2?

version 1.22.5

I get no node_modules after running yarn or yarn install

That seems like the underlying problem. Are you on yarn-v1 or yarn-v2?

I don’t have typescript installed locally, I’m not seeing the error, and it shouldn’t be a pre-requisite, one possible solution could be rather that using the tsc alone, you can use the path to local executable ./node_modules/.bin/tsc.

I’m using zsh as my shell interpreter in Mac, Linux and Windows

I get no node_modules after running yarn or yarn install

you can use the path to local executable ./node_modules/.bin/tsc.

Any hard-coded path implies an OS (windows has the opposite path separators). I would expect a lot of this to be handled by yarn internally. Could it be a yarn issue? What version are you using? Does it behave the same if you use node start instead of yarn start?

I don’t have typescript installed locally, I’m not seeing the error, and it shouldn’t be a pre-requisite, one possible solution could be rather that using the tsc alone, you can use the path to local executable ./node_modules/.bin/tsc.

I’m using zsh as my shell interpreter in Mac, Linux and Windows

@hipstersmoothie can confirm that installing TypeScript locally is what corrects this error.

Can I PR in a README change to help new users make sure they have the pre-requisite software installed as global libraries on their machine before they use the design systems cli?

Just an update that I also can reproduce the same error on my work Mac

Yarn is not recognized as an internal or external command
Yarn is not recognized as an internal or external command

I have tested this on Windows 10 Home / Pro, Mac and Linux (Ubuntu), everything is running fine for me, no errors following the indicated steps.

What happens if you type tsc in your Windows terminal? Also, which Windows terminal are you using? PowerShell? bash?

I have tested this on Windows 10 Home / Pro, Mac and Linux (Ubuntu), everything is running fine for me, no errors following the indicated steps.

Ok interesting. I’m using a fresh Windows after adding all new hardware. I’m going to start digging into this issue this week.

I have tested this on Windows 10 Home / Pro, Mac and Linux (Ubuntu), everything is running fine for me, no errors following the indicated steps.

I would like to work on this issue, I can test the solution in both platforms

@hipstersmoothie which approach do you prefer?

  1. Assume TypeScript is installed on user’s machine: add something to the README explaining this assumption and instructions on how to install TS.

  2. Add typescript to the package.json?

If you want to add this to hacktoberfest I can try and submit a PR for the fix.

How do you fix yarn not recognized?

To solve the error "'yarn' is not recognized as an internal or external command, operable program or batch file", install the yarn package globally by running npm install -g yarn , restart your terminal and make sure your PATH environment variable is set up correctly.

How do I run a yarn command in Windows?

Install Yarn on Windows Server via the MSI Installer.
Locate and double-click on the downloaded package. ... .
A new welcome wizard will pop up for the Yarn install setup. ... .
The next screen displays the license agreement details. ... .
To complete the Yarn package installation, click Install..

Can I install yarn with npm?

The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.

How do you use yarn commands?

yarn install: this command will install all the dependencies that is defined in a package. json file. once you have the package. json file for a project, all you need to do, is to go to your terminal and run npm install..
yarn add..
yarn init..
yarn install..
yarn publish..
yarn remove..