Closed rootsmusic closed 2 years ago
Hey, sorry for the delay--this notification looked like spam at first.
It maybe easier if you email alec@davesredistricting.org.
For now, it looks like npm isn't installing for some reason (Step 5). I couldn't really say why that is. Have you searched for those error messages?
npm is installed via nvm for Windows because npm -v
shows "8.11.0". Where's the file at https://registry.npmjs.org/@dra2020/topojson-simplify/-/topojson-simplify-3.0.102.tgz ? Thanks.
Ah, sorry. That appears to be private.
Let me investigate making it public.
Sorry for the delay.
Give this a try again now. That npm package should be public now.
@alecramsay Please also make https://registry.npmjs.org/@dra2020/baseclient/-/baseclient-1.0.67.tgz public.
Ugh, sorry.
You're the first person outside DRA to try this, and you're running into things that I don't as an insider.
Let me try to proactively figure out what all else needs to be made public and make it so.
Still checking whether we can definitively know in advance that all the dependencies are public, but in the meantime this one should be public too so give it a try.
Yea, npm install
works for dra-analytics! It returns the following message:
npm WARN config global
--global
,--local
are deprecated. Use--location=global
instead. npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated text-encoding@0.6.4: no longer maintained npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.added 678 packages, and audited 679 packages in 1m
69 packages are looking for funding run
npm fund
for details found 0 vulnerabilities
@alecramsay npm isn't working in dra-analytics-app. (Since it's related to a dependency file, I won't open another issue in https://github.com/terrencecrowley/chronology .) Please make https://registry.npmjs.org/@dra2020/dra-types/-/dra-types-1.8.57.tgz public.
I removed that dependency, as it wasn't needed. LMK if you run into any more problems. Very cool that you're doing this!
Out of curiosity, what are you going to do?
Note: Pull the latest from GitHub, to pick up the changes.
@alecramsay Please also make https://registry.npmjs.org/@dra2020/baseserver/-/baseserver-1.0.33.tgz public. I'm checking out the partisan analytics in the app.
Ack! Sorry. We'll get this figured out. Appreciate you being the guinea pig.
OK, that npm package is now public. Hopefully everything should work now!
Again, I apologize that this has taken a few turns of the crank. We've had a lot of our code public for a long time for transparency, but nothing fully standalone executable until these two repos, so we're still working out the kinks. Appreciate the bushwhacking :-).
The good news is npm install
works and returns the following message:
67 packages are looking for funding run
npm fund
for details3 vulnerabilities (1 moderate, 2 high) To address all issues, run: npm audit fix
Oy, sorry. I'll look into this ...
After pulling the latest from GitHub for dra-analytics-app, you need to run these 3 commands:
$ npm install
$ npm run build
$ npm run test
For some reason, the instructions omitted the first two -- I'll fix that -- though it looks like you did the install. You have to build as well, and then you should be able to start the server. (It's a much cut down clone of the main DRA client app & server.)
LMK if that does / doesn't work for you.
Sheez. I apologize for just how many things don't work outside the DRA team. Let me look into this ...
Is everything working for you now?
No @alecramsay, I did git pull
and npm run test
still produces the error:
0: info: Mode: DEVELOPMENT: running against development DynamoDB databases and S3 buckets Listening on port 3000 Started server at 2022-06-22T17:40:11.945Z 1: info: Listening on port 3000 2: info: Started server at 2022-06-22T17:40:11.945Z dynamodb: listTables error: {"message":"Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1","code":"CredentialsError","time":"2022-06-22T17:40:21.012Z","retryable":true,"originalError":{"message":"Could not load credentials from any providers","code":"CredentialsError","time":"2022-06-22T17:40:21.012Z","retryable":true,"originalError":{"message":"EC2 Metadata roleName request returned error","code":"TimeoutError","time":"2022-06-22T17:40:21.011Z","retryable":true,"originalError":{"message":"Socket timed out without establishing a connection","code":"TimeoutError","time":"2022-06-22T17:40:21.011Z","retryable":true}}}} 3: error: dynamodb: listTables: {"message":"Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1","code":"CredentialsError","time":"2022-06-22T17:40:21.012Z","retryable":true,"originalError":{"message":"Could not load credentials from any providers","code":"CredentialsError","time":"2022-06-22T17:40:21.012Z","retryable":true,"originalError":{"message":"EC2 Metadata roleName request returned error","code":"TimeoutError","time":"2022-06-22T17:40:21.011Z","retryable":true,"originalError":{"message":"Socket timed out without establishing a connection","code":"TimeoutError","time":"2022-06-22T17:40:21.011Z","retryable":true}}}} DB failed to open. Exiting.
Oh, right--sorry. I saw your question about vtd_data and forgot have a question out myself about how to resolve the issue above. I believe I know what's going on but not (yet) how to resolve it for you. I'll let you know when we do.
OK, this will be more involved to address. It'll probably be a few days before I can get back to you with it resolved.
Thanks for your patience.
OK, my amazing colleague, Terry, was able to fix this problem quicker than I expected.
Please:
git pull
npm install
npm run build
npm run test
Then the server should be running and you can open a browser window and point it at localhost:3000. LMK how this goes.
Thanks again for your patience and for working out the kinks in this! My bad for not catching them to begin with.
Good job, @terrencecrowley! There's no sample data set though, other than the example that doesn't have any district identifier. So I'll have to convert a file in https://github.com/dra2020/vtd_data/tree/master/2020_VTD to percentages. Am I limited to selecting a statewide office where there wasn't any third-party candidate (excluding write-in candidates)?
w00t! Thanks for persevering.
As noted in this Medium post, the app takes a partisan profile (JSON) of the form:
{
"statewide": 0.515036,
"byDistrict": [
0.423500,
0.428588,
0.433880,
0.443866,
0.454505,
0.456985,
0.458005,
0.458134,
0.463947,
0.473144,
0.718314,
0.736620,
0.775817
]
}
There aren't any district ids or labels--just two-party Democratic vote shares by district. The election you choose to use can have 3rd-party votes in them--most do--you just need to convert them two the two-party Democratic share. This, of course, ignores the 3rd-party votes. All the analytics analyze two-parties, so pick your election accordingly.
Since issue this is now solved, I'm going to close it. Please send questions & comments to our feedback email alias.
I'm a novice in Bash, Git, node and npm. I followed the instructions to run dra-analytics-app. Why do I get an error when I run npm? Thanks!
Steps in Git Bash:
cd ~/Documents/GitHub/vtd_data/
git clone https://github.com/dra2020/dra-analytics
cd ~/Documents/GitHub/vtd_data/dra-analytics
git pull
says "already up to date".npm install
(attached log) returns the error:npm run build
returns the error:cd ~/Documents/GitHub/vtd_data/
git clone https://github.com/dra2020/dra-analytics-app
cd ~/Documents/GitHub/vtd_data/dra-analytics-app
git pull
says "already up to date".npm install
returns same error as in step 5.npm run test
returns the error:Versions: Desktop: Windows 10 Git: 2.36.1.windows.1 nvm for Windows: 1.1.9 Node.js: 18.3.0 npm: 8.11.0 2022-06-16T01_50_17_426Z-debug-0.log