0
votes

I think I am doing something fundamentally wrong. I follow the simple installation step: yarn add advanced-react-scripts

After that, I am assuming that I have to change my package.json to the following ... "scripts": { "start": "advanced-react-scripts start", "build": "advanced-react-scripts build", "test": "advanced-react-scripts test --env=jsdom", "eject": "react-scripts eject" }, ...

but when I try to run yarn run build I get the following error: ` /usr/local/bin/node /usr/local/Cellar/yarn/1.3.2/libexec/bin/yarn.js run build yarn run v1.3.2 $ advanced-react-scripts build /bin/sh: advanced-react-scripts: command not found error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Process finished with exit code 1`

I am pretty sure I am missing something, maybe somebody can guide me in the right direction.

1

1 Answers

0
votes

Based on the docs it would seem that simply changing the scripts in the package.json is not enough.

These are the steps which should be taking if you are adding this to an existing create-react-app app.

(optional) If you have existing project created by create-react-app, you can remove default react-scripts

For it, run command:

npm uninstall --save react-scripts or yarn uninstall react-scripts

after doing that you install advanced scripts.

Next we need install advanced-react-scripts:

npm install --save-dev advanced-react-scripts or advanced-react-scripts

This is based on the docs found here -> https://www.npmjs.com/package/advanced-react-scripts