question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package react-scripts is installed as not a dev dependency

See original GitHub issue

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

  1. node -v: 8.0.0
  2. npm -v: 5.0.3
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected): 1.0.10
  5. create-react-app --version: 1.3.3

Then, specify:

  1. Operating system: macOS Sierra
  2. Browser and version (if relevant):

Steps to Reproduce

nvm use 8
npm install --global create-react-app
create-react-app test-app
cd test-app
cat package.json

Expected Behavior

Package react-scripts should appear in devDependencies section

Actual Behavior

Package react-scripts appears next to react-dom in dependencies section.

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

23reactions
stevenvachoncommented, Aug 6, 2017

Semantics.

8reactions
gaearoncommented, Jun 30, 2017

It fixes deployment issues on some hosting providers that assume only dependencies are needed for the build. The line is also very thin in frontend development. None of them are “runtime” dependencies because we don’t have a server and they all get bundled into a single file. So if we were pedantic then we would have to declare everything as devDependencies, including React itself. I just figured that it’s not worth conceptual overhead anyway since distinction is largely arbitrary. For example polyfills could be categorised as either.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to do a react build, when react-scripts is marked as dev ...
Project is created using CRA, so react-scripts is marked as dependency in package.json. If I mark react-scripts as dev-dependency, since i don't ...
Read more >
npm-install - npm Docs
As with regular git dependencies, dependencies and devDependencies will be installed if the package has a prepare script before the package is done...
Read more >
react-scripts: command not found error [Solved] | bobbyhadz
If the error is not resolved, try to delete your node_modules and package-lock.json (not package.json ) files, re-run npm install and restart your...
Read more >
Everything you need to know about react-scripts
In React apps, scripts are located in the package.json file's script section, ... This command will not only start the development server, ...
Read more >
Fix: React Scripts Command not Found Error - Medium
This command can be made without npm via the command ./node_modules/.bin/react-scripts start . Alternatively, if the react-scripts package were installed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found