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.

Failing on installing react-scripts

See original GitHub issue

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Many errors, especially related to “missing modules”, are due to npm bugs.

If you’re using Windows, follow these instructions to update npm.

If you’re using OS X or Linux, run this to update npm:

npm install -g npm@latest

cd your_project_directory
rm -rf node_modules
npm install

Then try to reproduce the issue again.

Can you still reproduce it?

Description

What are you reporting? When I create a project with create-react-app, it has failing on installing react-scripts package. I am not sure this is create-react-app issue or yarnpkg issue because when I tried to install react-scripts with yarnpkg separately, it has same issue. However, current create-react-app depends on the yarnpkg which has issue, I think it should be addressed.

Expected behavior

It should create a project without aborting, or if it is aborted, it should not delete the folder. Since it deletes the folder, the yarn-error.log file is gone.

Actual behavior

Got this message.

 mshin@1s5cj12-l  ~/Workspace/github  create-react-app test-app
Creating a new React app in /Users/mshin/Workspace/github/test-app.

Installing packages. This might take a couple minutes.
Installing react, react-dom, and react-scripts...

yarn add v0.24.5
info No lockfile found.
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.npmjs.org/@timer%2fdetect-port: Could not authenticate npm".
info If you think this is a bug, please open a bug report with the information provided in "/Users/mshin/Workspace/github/test-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts has failed.

Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting test-app / from /Users/mshin/Workspace/github
Done.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
  2. node -v: v6.9.5
  3. npm -v: 3.10.10

Then, specify:

  1. Operating system: Mac OS Sierra 10.12.5
  2. Browser and version: N/A

Reproducible Demo

mshin@1s5cj12-l  ~/Workspace/github  create-react-app test-app
Creating a new React app in /Users/mshin/Workspace/github/test-app.

Installing packages. This might take a couple minutes.
Installing react, react-dom, and react-scripts...

yarn add v0.24.5
info No lockfile found.
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.npmjs.org/@timer%2fdetect-port: Could not authenticate npm".
info If you think this is a bug, please open a bug report with the information provided in "/Users/mshin/Workspace/github/test-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts has failed.

Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting test-app / from /Users/mshin/Workspace/github
Done.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Timercommented, May 19, 2017

Can you try running yarn logout and npm logout? Then try to setup an app again.

2reactions
gaearoncommented, May 19, 2017

Looks like a Yarn bug. Can you try uninstalling Yarn and trying again?

We should add some way to fall back to npm on errors in Yarn but we don’t have that code yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-scripts 4.0.1 errors out during npm install #9978 - GitHub
When using react-scripts version 4.0.0, attempting to run npm i causes an error. The following is then displayed: npm ERR!
Read more >
Fixing 'react-scripts' is not recognized error - Nathan Sebhastian
If the error still appears, try to delete your node_modules folder first, then re-install your dependencies: · That should add the package and ......
Read more >
Fix: React Scripts Command not Found Error - αlphαrithms
Quick Intro: React Apps Setup 101 · The Problem: Running a React-Scripts Command · Fix 1: Run npm install · Fix 2: Delete...
Read more >
react-scripts: command not found - Stack Overflow
I have installed create-react-app and then when I change into the directory and hit npm start I get a react-scripts: command not found...
Read more >
Fix: React Scripts Command not Found Error - Medium
Fix 1: Run npm install ... In the case where an app might have been cloned, the node_modules directory would not have been...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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