Polymer / pwa-starter-kit

Starter templates for building full-featured Progressive Web Apps from web components.
https://pwa-starter-kit.polymer-project.org
2.36k stars 431 forks source link

Needed to refer to this in order to get pwa-start-kit to work out of the box. #346

Closed karlnicholas closed 5 years ago

karlnicholas commented 5 years ago

@keanulee Solved! Thanks for your help!

The final solution was found after reading your reply and did more googling accordingly here, and I believe it will be very helpful if these steps below are included somewhere in the PWA Starter Kit's "Get Started" website for anyone who use the kit to build their app while continuing to pull in new changes from the kit.

Essentially, here are the steps to npm install locally --- without ending up with a different package-lock.json --- anytime pwa-starter-kit's master branch has its deps updated:

  1. Pull in the new version from pwa-starter-kit's master branch, including package-lock.json.
  2. Run rm -rf node_modules/ to remove the entire node_modules folder, reason quoted from the link above.

Deleting the existing node_modules before continuing is an essential step because the package-lock.json does parse existing metadata from the node_modules folder. This means that if your node_modules folder has leftovers, they may get added to the package-lock's dependencies, even if they're not an actual dependency (anymore).

  1. Do NOT delete the pulled in package-lock.json file.
  2. Run npm install
  3. Done!

Originally posted by @freshgrapes in https://github.com/Polymer/pwa-starter-kit/issues/256#issuecomment-434559958

keanulee commented 5 years ago

Was there any action required for this issue? Leave a comment if there is.

karlnicholas commented 5 years ago

Yes, bottom line is that doing the pwa starter kit doesn't work out of the box. The above commands must be executed after creating the app before it will properly run.

logicalphase commented 5 years ago

I'm not sure I understand why you need to remove node_modules on an initial install.

If you git clone the repo there's no node_modules prior to running npm i

I just ran an install based on the directions found at https://pwa-starter-kit.polymer-project.org/setup, and they work without issue.

Maybe I'm missing something. So, please reply back with details if need be.