question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yarn watch failed with "'cross-env' is not recognized as an internal or external command"

See original GitHub issue

On a fresh clone on a Windows system, running yarn watch fails with the following error:

PS C:\Projects\OSS\react-browser-extension-boilerplate-master> yarn watch
yarn run v1.22.10
$ cross-env NODE_ENV=development yarn webpack -c webpack.config.js --mode development -w
'cross-env' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I installed cross-env manually: npm install -g cross-env

Then I started to see a different error:

yarn run v1.22.10
$ cross-env NODE_ENV=development yarn webpack -c webpack.config.js --mode development -w
error Command "webpack" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
uluhonolulucommented, Dec 2, 2020

OK, that was it, now it works. Perhaps you want to add it to the README so that the next noob won’t bug you with the same issue.

1reaction
ElForasterocommented, Dec 2, 2020

Shouldn’t I run yarn install or something like that? I’ve been sitting in the npm universe for too long I guess.

That’s it 😃

Yarn is much like npm. You should clone repo and then execute yarn install to install all dependencies.

You can use npm instead of yarn. Just replace yarn webpack with npm webpack.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel 5.4 'cross-env' Is Not Recognized as an Internal or ...
Your error states that cross-env is not installed. 'cross-env' is not recognized as an internal or external command, operable program or ...
Read more >
'cross-env' is not recognized as an internal or external command
Failed at the react-redux-realworld-example-app@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional ...
Read more >
'cross-env' is not recognized as an internal or ... - Laracasts
I'm building a Laravel 8 project using Vue2. The initial problem was that Chrome dev tools did recognize Vue, but does not show...
Read more >
'cross-env' is not recognized as an internal or external command
1. You need to make cross-env working globally instead of having it in the project. ; 2. ​ ; 3. 1) remove node_modules...
Read more >
react-scripts' is not recognized as an internal or external ...
error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found