Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Run on Windows #420

Closed
ahoad opened this issue Jun 12, 2020 · 23 comments · Fixed by #421
Closed

Unable to Run on Windows #420

ahoad opened this issue Jun 12, 2020 · 23 comments · Fixed by #421
Assignees
Labels
bug Something isn't working os: windows

Comments

@ahoad
Copy link

ahoad commented Jun 12, 2020

  1. Cloned the repository

  2. ran yarn install

  3. On running yarn start i got the below error:
    $ cp data/database-seed.json data/database.json 'cp' is not recognized as an internal or external command, operable program or batch file.

  4. Changed the cp commands to copy so they would work on windows.

  5. Then got the below error:
    $ copy data/database-seed.json data/database.json data\database-seed.json The file cannot be copied onto itself. 0 file(s) copied.

  6. Changed the / in package.json to \

  7. Then got the below error:
    NODE_ENV=development concurrently yarn:start:react yarn:start:api 'NODE_ENV' is not recognized as an internal or external command, operable program or batch file.

  8. Added SET before NODE_ENV

  9. No errors on running yarn start this time but also appears that nothing has started

  10. Run yarn cypress:open and try running a test

  11. Get errors due to app not starting

@kevinold kevinold self-assigned this Jun 12, 2020
@kevinold
Copy link
Contributor

Hi @ahoadshieldpay,

Thanks for this report.

Which version of Windows are you running?
What terminal program are you using?

@amirrustam amirrustam added bug Something isn't working os: windows labels Jun 12, 2020
@ahoad
Copy link
Author

ahoad commented Jun 12, 2020

Version: Windows 10 pro
Terminal: The terminal in Visual Studio Code

@anubhavsinghal07
Copy link

anubhavsinghal07 commented Jun 12, 2020

@kevinold.

Getting exactly same issue in Win 7 as well, using cmd terminal.

@LucasL94
Copy link

Hello and sorry to intrude in this post. Just want to say that I was having the same issue on Windows 10. However, I cloned the fix-windows branch and everything's up and running perfectly now.

Thanks @kevinold. That was a quick response 👍

@amirrustam
Copy link
Contributor

@frogcatcher the draft PR is displayed within this thread above, here is the PR link for your convenience: #421

@ahoad
Copy link
Author

ahoad commented Jun 15, 2020

Hello and sorry to intrude in this post. Just want to say that I was having the same issue on Windows 10. However, I cloned the fix-windows branch and everything's up and running perfectly now.

Thanks @kevinold. That was a quick response 👍

I've also just tried cloning the pull request and things are getting further, but on running yarn start or yarn dev I am now getting a compile error:

Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

@LucasL94
Copy link

@frogcatcher the pull request is code that has been sent to a specific branch, that's where it's tested and prepare before merging to the main one. The branch it was sent to is that one that I mentioned before. You can look for the different branches while being on the code tab

@ahoadshieldpay that might be happening because if you check the pull request, there are new dependencies added in the package.json.
Try running yarn install again and it should be fixed

@amirrustam
Copy link
Contributor

@LucasL94 we appreciate your efforts in helping out the community. 🙏

@ahoad
Copy link
Author

ahoad commented Jun 15, 2020

@LucasL94 still no luck, but thanks for the help.

I tried again from the beginning - deleted it all and cloned again, checkout to the pull request and ran through the steps again including yarn install.

Still getting compile error:
Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

@kevinold
Copy link
Contributor

Hi @ahoadshieldpay,

What version of Node are you running? In the VS Code Terminal type node --version and please report back.

These updates are set to work against Node version 12.x

@ahoad
Copy link
Author

ahoad commented Jun 15, 2020

v14.3.0

@kevinold
Copy link
Contributor

v14.3.0

@ahoadshieldpay

Yes, that is the issue you are seeing now. We are using Node version 12, so you will need to downgrade in order to use this application.

@ahoad
Copy link
Author

ahoad commented Jun 15, 2020

v14.3.0

@ahoadshieldpay

Yes, that is the issue you are seeing now. We are using Node version 12, so you will need to downgrade in order to use this application.

I have downgraded, now on v12.18.0

Went through all the steps again but still getting the same error.

@frogcatcher
Copy link

I gave up and removed everything and did a new git. And got the same errors.
Then, I finally found the fix-windows Branch here: https://github.com/cypress-io/cypress-realworld-app/tree/fix-windows * But, I do not know what action to take/what commands to run to get this fix-window branch incorporated.
Note: I thought starting over (see first statement) would be the novice solution to get whatever was in fix-windows, but I didn't experience any progress in my re-do attempt.
Could someone please explain to me what steps I need to take to get those fix-windows branch changes?

Also, been following the threads.
I'm using Windows 10, Node version 12.x, and did according to ahoadshieldpay and added SET in front of NODE_ENV.

I continue to get stuck on this error when I enter the command yarn start or yarn dev.

$ yarn db:seed:dev
$ copy data/database-seed.json data/database.json
data\database-seed.json
The file cannot be copied onto itself.

ahoadshieldpay mentioned fixing the \ to /. However, I do not see the \ in the package.json file. All of them are . Is there somewhere else that I need to make this change?

Thank you!

@kevinold
Copy link
Contributor

@frogcatcher

You do not need to modify any of the code on the fix-windows branch.

Follow these steps to use the fix-windows branch

  1. git checkout fix-windows
  2. yarn install
  3. yarn dev

@kevinold
Copy link
Contributor

I have downgraded, now on v12.18.0

Went through all the steps again but still getting the same error.

@ahoadshieldpay Reclone the project into a new directory and verify in the terminal in VS Code that it is using Node 12.18 (via node -v)

@frogcatcher
Copy link

Thank you kevinold and everyone! Mine is working now. :)

@kpmck
Copy link

kpmck commented Jun 15, 2020

I am experiencing the same behavior as @ahoadshieldpay where I am getting a Failed to Compile error on execution. Full error below.

Node: v12.18.0
Steps to repro:

  • Fresh clone of repository (attempted in two separate directories)
  • git checkout fix-windows
  • yarn install
  • yarn dev

Error received:

./src/svgs/undraw_personal_finance_tqcd.svg (./node_modules/@svgr/webpack/lib?-svgo,+titleProp,+ref!./src/svgs/undraw_personal_finance_tqcd.svg)
Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'
Require stack:
- C:\del\cypress-realworld-app\node_modules\@svgr\webpack\node_modules\@babel\preset-env\lib\polyfills\corejs3\usage-plugin.js
- C:\del\cypress-realworld-app\node_modules\@svgr\webpack\node_modules\@babel\preset-env\lib\index.js
- C:\del\cypress-realworld-app\node_modules\@svgr\webpack\lib\index.js
- C:\del\cypress-realworld-app\node_modules\loader-runner\lib\loadLoader.js
- C:\del\cypress-realworld-app\node_modules\loader-runner\lib\LoaderRunner.js
- C:\del\cypress-realworld-app\node_modules\webpack\lib\NormalModule.js
- C:\del\cypress-realworld-app\node_modules\webpack\lib\NormalModuleFactory.js
- C:\del\cypress-realworld-app\node_modules\webpack\lib\Compiler.js
- C:\del\cypress-realworld-app\node_modules\webpack\lib\webpack.js
- C:\del\cypress-realworld-app\node_modules\react-scripts\config\webpack.config.js
- C:\del\cypress-realworld-app\node_modules\@cypress\instrument-cra\index.js
- internal/preload

@kevinold
Copy link
Contributor

@kpmck Thanks for this report. Investigating further.

cc @ahoadshieldpay

@kevinold
Copy link
Contributor

@ahoadshieldpay @kpmck

I've confirmed I'm able to reproduce this "Failed to compile" error locally and am investigating further.

@LucasL94
Copy link

Hey @kevinold . Could you try with some of the following?

A. Deleting node_modules and yarn.lock and then installing things again?

B. Running yarn upgrade @babel/preset-env

C. Adding @babel/compat-data

I think that some of those might fix the issue. Deleting the yarn.lock without knowing what the actual problem is might be a bad practice though

@kevinold
Copy link
Contributor

@ahoadshieldpay @kpmck

The fix just pushed to the fix-windows branch (2010c66) should fix your issue.

Simply git pull the latest from the fix-windows branch, run yarn install and yarn start should compile the application successfully.

cc @LucasL94

amirrustam pushed a commit that referenced this issue Jun 15, 2020
* install ncp and cross-env; update npm scripts

* downgrade react scripts to 3.40 for windows; move tsnode config to file

facebook/create-react-app#8707 (comment)

* update circle config to run tests on windows

* update windows run to use cypress orb

* update windows executor

* require setup for windows build

* downgrade babel-loader for react-scripts 3.4.0

* setup linux and windows workflows

* update windows workflow to install google chrome and run test in chrome

* update windows to run against electron

* wait for notifications

* update with additional wait for notifications

* add additional wait for notifications

* add additional notifications wait

* add additional assertion to make sure the list has been updated

* update to fix flake

* fix length counts for flake

* update to fix count and waits for flake

* add assertion to retry for correct count

* ensure the like registers

* name jobs

* cypress info on Windows

* disable install of google chrome on windows

* wait on comment to be posted to fix flake

* resolve babel/compat-data to v7.9.0 to fix failed to compile error

#420 (comment)

Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
@ahoad
Copy link
Author

ahoad commented Jun 16, 2020

@kevinold Thank you for the quick fix, it's now working

obaidaattaee pushed a commit to obaidaattaee/cypress-realworld-app that referenced this issue Nov 30, 2021
* install ncp and cross-env; update npm scripts

* downgrade react scripts to 3.40 for windows; move tsnode config to file

facebook/create-react-app#8707 (comment)

* update circle config to run tests on windows

* update windows run to use cypress orb

* update windows executor

* require setup for windows build

* downgrade babel-loader for react-scripts 3.4.0

* setup linux and windows workflows

* update windows workflow to install google chrome and run test in chrome

* update windows to run against electron

* wait for notifications

* update with additional wait for notifications

* add additional wait for notifications

* add additional notifications wait

* add additional assertion to make sure the list has been updated

* update to fix flake

* fix length counts for flake

* update to fix count and waits for flake

* add assertion to retry for correct count

* ensure the like registers

* name jobs

* cypress info on Windows

* disable install of google chrome on windows

* wait on comment to be posted to fix flake

* resolve babel/compat-data to v7.9.0 to fix failed to compile error

cypress-io#420 (comment)

Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os: windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants