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

trouble getting a dev environment set up #1145

Closed
pdurbin opened this issue Jan 8, 2023 · 13 comments
Closed

trouble getting a dev environment set up #1145

pdurbin opened this issue Jan 8, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@pdurbin
Copy link
Contributor

pdurbin commented Jan 8, 2023

@holmesworcester encouraged me to work on an issue but I'm having trouble getting a dev environment set up. I'm on macOS 10.14.6

I'm on b599a1b on the "develop" branch and following packages/desktop/README.md

npm install went fine.

Here's the error:

$ npm run lerna bootstrap

> lerna
> lerna

lerna notice cli v4.0.0
lerna info versioning independent
lerna info Bootstrapping 9 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in 'quiet'
lerna ERR! npm install stderr:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @cypress/react@5.12.0
npm ERR! Found: @types/react@18.0.25
npm ERR! node_modules/@types/react
npm ERR!   dev @types/react@"^18.0.25" from the root project
npm ERR!   peerOptional @types/react@"^17.0.0 || ^18.0.0" from @mui/base@5.0.0-alpha.107
npm ERR!   node_modules/@mui/base
npm ERR!     @mui/base@"5.0.0-alpha.107" from @mui/lab@5.0.0-alpha.109
npm ERR!     node_modules/@mui/lab
npm ERR!       @mui/lab@"^5.0.0-alpha.109" from the root project
npm ERR!     @mui/base@"5.0.0-alpha.107" from @mui/material@5.10.15
npm ERR!     node_modules/@mui/material
npm ERR!       @mui/material@"~5.10.15" from the root project
npm ERR!       2 more (@mui/icons-material, @mui/lab)
npm ERR!   16 more (@mui/icons-material, @mui/lab, @mui/material, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @types/react@"^16.9.16 || ^17.0.0" from @cypress/react@5.12.0
npm ERR! node_modules/@cypress/react
npm ERR!   dev @cypress/react@"5.12.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @types/react@17.0.52
npm ERR! node_modules/@types/react
npm ERR!   peerOptional @types/react@"^16.9.16 || ^17.0.0" from @cypress/react@5.12.0
npm ERR!   node_modules/@cypress/react
npm ERR!     dev @cypress/react@"5.12.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/family/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/family/.npm/_logs/2023-01-08T18_29_29_059Z-debug-0.log
lerna ERR! npm install exited 1 in 'quiet'
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.

Here's the log mentioned in the error:
2023-01-08T18_29_29_059Z-debug-0.log.txt

@holmesworcester holmesworcester added the bug Something isn't working label Jan 8, 2023
@holmesworcester
Copy link
Contributor

holmesworcester commented Jan 8, 2023

I'm also seeing errors.

Let's resolve this and make sure there's a test that runs on every merge (and blocks merging) that ensures that the commands listed in the README will successfully build and start the app for developers. We'll have to remember to change the instructions if they must change.

These instructions falling out of date is probably our most tenacious regression.

Requirements:

  1. A test to make sure this works on linux and mac.
  2. A test for M1 macs if the instructions are different, or a fix for the issue with building on M1 macs (it was a leveldb issue I believe) so that they aren't different. (Many potential volunteers use M1 macs)
  3. Should not require sudo.

The fewer steps in the instructions, the better. Ideally it's just npm install, npm run start.

@EmiM
Copy link
Contributor

EmiM commented Jan 9, 2023

Connected: #1146

@holmesworcester
Copy link
Contributor

holmesworcester commented Jan 9, 2023

A partial solution here is to set engines in package.json so we'll get an informative error message when people are using the wrong node or npm versions. See: https://www.marcusoft.net/2015/03/packagejson-and-engines-and-enginestrict.html

Another partial solution is to run all our tests and build checks on M1 Mac in CI, so that we see any issues. (M1 is supported now by github actions.)

@pdurbin
Copy link
Contributor Author

pdurbin commented Jan 10, 2023

Good news, I got it working on Mac. Like @holmesworcester said in Quiet-Team, switching to the exact version of node in the README helped.

I decided to try my Linux box as well. I got a different error:

[pdurbin@tabby quiet]$ npm run lerna bootstrap

> lerna
> lerna "bootstrap"

lerna notice cli v4.0.0
lerna info versioning independent
lerna info Bootstrapping 9 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in 'quiet'
lerna ERR! npm install stderr:
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pdurbin/.npm/_logs/2023-01-10T00_28_30_827Z-debug-0.log
lerna ERR! npm install exited 1 in 'quiet'
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.

Here's the log: 2023-01-10T00_28_30_827Z-debug-0.log.txt

I'm not sure why it's complaining about a proxy. This Linux box and the Mac are on the same wifi network at my house. I never need a proxy.

Any ideas for me?

@holmesworcester
Copy link
Contributor

@siepra @EmiM @vinkabuki have you seen this?

@holmesworcester
Copy link
Contributor

holmesworcester commented Jan 10, 2023

@pdurbin just googling it seems like something that can happen for strange reasons sometimes, maybe due to something you did in the past with node.

See this comment, for example: https://stackoverflow.com/a/32316770/5081055 -- does that fix work? Or do any of the other fixes in that thread seem to fit your case?

I'm going to move this out of the sprint for now because i think it's likely not a problem with the repo on our end. It could be but let's rule out a few things first.

@holmesworcester
Copy link
Contributor

Scratch that, I'm getting the exact same error when I clone the repo and attempt the install steps on Debian (bullseye) on my Chromebook. And @josephlacey is getting another error related to downloading files.

@holmesworcester
Copy link
Contributor

holmesworcester commented Jan 10, 2023

@pdurbin can you confirm you're in the develop branch and using npm 16.14.2?

@pdurbin
Copy link
Contributor Author

pdurbin commented Jan 10, 2023

Yes, b599a1b on develop. I assume you mean node. I'm on 16.14.0 per the README. From the log I uploaded:

1 info using npm@8.3.1
2 info using node@v16.14.0

@holmesworcester
Copy link
Contributor

let's try using 16.14.2 and corresponding npm

@holmesworcester
Copy link
Contributor

And if you run into the SOCKET_TIMEOUT error, @siepra says:

See: https://stackoverflow.com/questions/51434006/how-to-fix-timeout-for-packages-on-npm-install
It looks like a poor internet connection. Maybe worth trying turning off VPN? Make sure no network traffic goes through tor? Start with increasing npm timeouts and then try clearing cache.

@josephlacey
Copy link
Collaborator

Oddly I just tried to reproduce this error on commit b599a1b with node 16.14.0 and npm 8.3.1, but it all compiled and started fine with

npm install
npm run lerna bootstrap
cd packages/desktop/
npm run start

I reran all the steps above on the same commit with node 16.14.2 and npm 8.5.0, and that also compiled and started fine.

If the errors we all got were related to timeouts, it could have been the fact that we were on video calls during the process. Seems like a strange problem to contend with, but I guess one to be mindful of. As per the linked StackOverflow post, I installed pnpm and reran the Quiet install process. I wouldn't say there was a noticeable difference in the time for each step, but there's data to show it makes a difference in general. It might be worth using pnpm when on a video call and rerun the process.

If that does make a difference, it might be worth including a suggest to use pnpm as a part of step 0.

There could have been other upstream issues, but that's only speculative.

@pdurbin
Copy link
Contributor Author

pdurbin commented Feb 11, 2023

Thanks for the chatter here. I got a new laptop (and now have a different problem which I reported in #1213) and plan to focus my energy on getting a dev environment working there so I'm closing this issue.

@pdurbin pdurbin closed this as completed Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants