Yarn watch failed with "'cross-env' is not recognized as an internal or external command"
See original GitHub issueOn 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:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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
withnpm webpack
.