Skip to content

Conversation

@mars
Copy link
Owner

@mars mars commented Jul 2, 2017

npm 5 dramatically changes npm install behavior by using a deterministic lock file. Unfortunately, this causes the modules installed by npm install --only=dev to be erased before the build. So, create-react-app's build process stops working!

This changeset revises the order of installation to dependencies first, then devDependencies, and it forces npm to ignore the lock file (using the --no-shrinkwrap flag) for devDependencies.

It comes at the price of, when package-lock.json is present, removing & reinstalling all devDependencies on each deploy.

Another solution is to manually move react-scripts (& other devDeps required for build) to the productiondependencies in package.json.

@mars mars merged commit 80bbce5 into master Jul 5, 2017
Repository owner deleted a comment from patotoma Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant