Open Arique1104 opened 8 months ago
Updated code: https://github.com/MoveOnOrg/Spoke/pull/2310
If nothing breaks at version 18, please stretch to Nodejs version 20
Learning goals:
Setting the 20 stretch goal aside and focusing on 18
upgrade procedure:
1) change package.json engine for node and npm, and .nvmrc
2) install new node version with nvm (node version manager) nvm install v18.18.2
(and make it the default with nvm alias default v18.18.2
)
3) update new packages with npm (node package manager) npm update
4) see if any issues can be automatically resolved with npm audit fix
5) force available automatic updates with npm audit fix --force
6) dependency adventures!
7) tests
8) save newly updated packages to package.json with npm update --save
package audit output https://pastebin.com/SmiraX5H
Output from yarn install flags dependency issues https://pastebin.com/gezGMu8V
full changes, upgraded to main for easier merging (Stephanie was running a pre- 13.1 version + seems to have been pushing to an inaccessible Github account) https://github.com/StateVoicesNational/Dispatch/tree/node18
Test case output does not run successfully
BLOCKER FOR FINISHING NODE18 UPDATE: https://github.com/StateVoicesNational/Spoke/issues/6
What did you learn?
Priorities for tomorrow:
There are a variety of different references for the Node that we are using.
npm audit fix --force
changes a whole heckuva lot of files, highlights the previously noted unresolvable issues with e.g. apollo and graphql with additional notes (some of which say themselves could be fixed with an npm audit fix --force
, suggesting they may need to be fix force'ed on a package-by-package basis (yes I did try running it a second time)
pushed to previous node18 branch
full output from npm audit fix --force
: https://pastebin.com/GcgYTJd3
full output after audit fix, from yarn install
(significantly fewer warnings, along the lines as described above): https://pastebin.com/PSxjmzNu
10245 rm -rf Spoke_Hackathon_Fork
10246 ls
10247 cd ..
10248 rm -rf node-update
10249 ls
10250 mkdir node-update
10251 cd node-update
10252 ls
10253 gh repo clone StateVoicesNational/Spoke_Hackathon_Fork
10254 ls
10255 cd Spoke_Hackathon_Fork
10256 git checkout -b node20-update-II
10257 node -v
10258 npm -v
10259 npm outdated
10260 npm install
10261 npm outdated
10262 git status
10263 git add .
10264 git commit -m "Ran npm install and got a yarn.lock file update. Keeping to learning purposes"
10265 npm audit
10266 npm ls
10267 npm outdated --depth
10268 npm install @babel/cli 7.23.4 --save
10269 npm install @babel/cli@7.23.4 --save
10270 git status
10271 git add .
10272 git commit -m "Adds @babel/cli@7.23.4 to dependencies"
10273 npm ls @babel/cli@7.23.4
10274 npm ls @babel/cli@7.23.4 --depth
10275 npm ls @babel/core
10276 npm install @babel/core@7.23.4 --save
10277 git status
10278 git add .
10279 git status"\n"
10280 git status
10281 git add .
10282 git commit -m "Removes web-cli from optional dependencies"
10283 git status
10284 npm ls @babel/traverse
10285 npm install @babel/traverse@7.23.2 --save
10286 git status
10287 git add .
10288 git commit -m "Adds babel/traverse version 7.23.2 to package and yarn lock"
10289 git push origin node20-update-II
10290 npm audit fix
10291 git status
10292 git add .
10293 git commit -m "Ran npm audit fix"
10294 git push origin node20-update-II
10295 npm audit
10296 npm outdated --depth
10297 npm use
10298 npm install
10299 npm un react-dnd@11.1.3
10300 git status
10301 npm uninstall react-dnd@7.7.0
10302 npm install react-dnd@11.1.3 --save
10303 npm install react-dnd@7.7.0
10304 npm install react-dnd@7.7.0 --save
10305 npm install
10306 git add .
10307 git commit -m "Adds react-dnd version 7.7.0 to dependencies"
10308 git push origin node20-update-II
10309 npm outdated
10310 npm ls @babel/core
10311 npm audit
10312* npm ls @cypress/request
10313* npm install @cypress/request@2.88.12 --save
10314 npm ls @cypress/request
10315 npm up @cypress/request
10316 git status
10317 yarn dev
10318 cp .env.example .env
10319 yarn dev
10320 npm install node@20.0.0 --save
10321 npm install npm@9.6.4
10322 git status
10323 git add .
10324 history
10325 git status
10326 yarn dev
10327 npm ls aws-sdk --all
10328 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/action-handlers/mobilecommons-signup.js
10329 git status
10330 git add .
10331 git commit -m "Updates mobilecommons-signup to remove aws-sdk which is deprecated"
10332 yarn dev
10333 git push origin node20-update-II
10334 npm install @babel/plugin-transform-class-properties
10335 git add .
10336 git commit -m "Adds babel/plugin-transform-class-properties to project dependencies"
10337 yarn dev
10338 git push origin node20-update-II
10339 npm install @babel/plugin-transform-nullish-coalescing-operator --save
10340 git add .
10341 git commit -m "Adds @babel/plugin-transform-nullish-coalescing-operator to project dependencies"
10342 yarn dev
10343 git push origin node20-update-II
10344 npm install @babel/plugin-transform-optional-chaining
10345 git add .
10346 git commit -m "Adds @babel/plugin-transform-optional-chaining into project dependencies"
10347 yarn dev
10348 git push origin node20-update-II
10349 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/action-handlers/revere-signup.js
10350 git status
10351 git add .
10352 git commit -m "Upgrades aws-sdk to version 3 standards"
10353 yarn dev
10354 history
10355 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/contact-loaders/csv-s3-upload/index.js
10356 yarn dev
10357 git status
10358 git add .
10359 git commit -m "Upgrades csv-s3-upload index file to use version 3 aws"
10360 git push origin node20-update-II
10361 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/contact-loaders/s3-pull/index.js
10362 yarn dev
10363 history
10364 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/workers/jobs.js
10365 yarn dev
10366 git status
10367 git add .
10368 git commit -m "Updates jobs.js to version 3 standards of aws - beginning of breaking change"
10369 npm install @aws-sdk/client-lambda --save
10370 yarn dev
10371 history
10372 git add .
10373 git commit -m "Adds @aws-sdk/client-lambda to dependencies"
10374 yarn dev
10375 npm install @aws-sdk/s3-request-presigner --save
10376 git add .
10377 git commit -m "Adds aws-sdk/s3-request-predesigner to dependencies"
10378 yarn dev
10379 npm install @aws-sdk/client-s3 --save
10380 git add .
10381 git commit -m "Adds @aws-sdk/client-s3 to project dependencies"
10382 yarn dev
10383 npm install @aws-sdk/client-sqs --save
10384 yarn dev
10385 git add .
10386 git commit -m "Adds aws-sdk/client-sqs - end of breaking changes"
10387 git push origin node20-update-II
10388 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/contact-loaders/s3-pull/index.js
10389 yarn dev
10390 git status
10391 git add .
10392 git commit -m "Upgrades s3-pull index file to use version 3 of aws"
10393 git push origin node20-update-II
10394 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/job-runners/lambda-async/index.js
10395 yarn dev
10396 git status
10397 git add .
10398 git commit -m "updates lambda-async index.js to use version 3 aws-sdk"
10399 git push origin node20-update-II
10400 npm install @aws-sdk/client-lambda --save
10401 git status
10402 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/server/telemetry.js
10403 yarn dev
10404 git add .
10405 git commit -m "Updates telemetry.js to version 3 of aws-sdk"
10406 npm install @aws-sdk/client-cloudwatch --save
10407 git status
10408 git push origin node20-update-II
10409 git status
10410 git commit -m "Updates telemetry to use cloudwatch events and client cloud watch"
10411 git push origin node20-update-II
10412 git add .
10413 git commit -m "Adds aws-sdk/client-cloudwatch to project dependencies"
10414 yarn dev
10415 npm install @aws-sdk/client-cloudwatch-events --save
10416 git add .
10417 git commit -m "Adds @aws-sdk/client-cloudwatch-events to project dependencies"
10418 yarn dev
10419 npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/lambda.js
10420 yarn dev
10421 git status
10422 git add .
10423 git commit -m "Upgrades lambda.js to version 3 of aws-sdk"
10424 git push origin node20-update-II
10425 yarn dev
10426 npm outdated
10427 history
10428 nvm install 20.0.0
10429 nvm alias default 20.0.0
10430 git status
10431 npm install
10432 node -v
10433 npm -v
10434 git add .
10435 yarn dev
10436 git status
10437 git add .
10438 git status
10439 git commit -m "Updates node engine to v 20.0.0 and npm to v 9.6.4"
10440 git status
10441 git add .
10442 git commit -m "Ran npm install"
10443 git push origin node20-update-II
Update the Nodejs version to 18 to avoid Twilio deprecation. Stephanie & Daniel