"react-scripts" is not recognized

(Mike) #1

Installled NPM and tried to run the following command (per my website designer) to load edited local content back to my website:

npm run build

But I received the following error:

“react-scripts” is not recognized (and then a bunch of ERR! codes)

Any idea what the issue is? I’m a beginner with very little programming knowledge so any help is very appreciated.

Mike

0 Likes

(Lars Willighagen) #2

It looks like you’re missing react-scripts. Have you installed the local packages? Use:

npm install
0 Likes

(Mike) #3

I downloaded node.js for Windows and installed that way.
Do I just type in “npm install” in a command line? In what directory?

Sorry - total newbie here.

0 Likes

(Lars Willighagen) #4

No problem :slight_smile:. Yes, run npm install in the command line in the same directory where you ran npm run build (i.e. the project directory). That should install all the necessary dependencies of the project.

0 Likes

(Mike) #5

ok, that worked and it looks like the build was working but then I received a new error…

npm

0 Likes

(Mike) #6

but it looks like there is a build folder in the target directory. Make sense?

0 Likes

(Lars Willighagen) #7

Looks like some tool is using an older version of Browserlist, you can check out which one with

npm ls browserslist@<4
0 Likes

(Mike) #8

ok, tried that but it says the “system can not find the file specified”…

0 Likes

(Lars Willighagen) #9

Right, sorry, you’d need to escape the <.

npm ls "browserslist@<4"

or better yet just

npm ls browserslist
0 Likes

(Mike) #10

ok, it says the following…

'--

when I installed node.js, I installed 10.15.3 LTS (not 11.12.0 Current).
Could that be an issue?

0 Likes

(Mike) #11

sorry…meant to say it says the following…

'--

0 Likes

(Lars Willighagen) #12

The <empty> is being removed because it thinks it’s HTML, you can avoid that by putting the text in fences:

```
'-- <empty>
```

Or by starting each line with four spaces:

    '-- <empty>

That’s weird though, did you run the command in the same project directory? Otherwise, try

npm ls -g browserslist
0 Likes

(Mike) #13

oh, ok. got it

yes - ran it in the same project directory.
same result with the npm ls -g browserslist

npm

0 Likes

(system) closed #14

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

0 Likes