0

When i start my app with command npm start all ok, but when i build my app with command npm run build i get error

13 verbose stack Error: [email protected] build: `react-scripts build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

What can be wrong?

EDIT I create my app using command create-react-app myapp. Index.js look like

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import 'bootstrap/dist/css/bootstrap.css';
import {BrowserRouter} from 'react-router-dom';
ReactDOM.render(
    <BrowserRouter>
        <App/>
    </BrowserRouter>
    , document.getElementById('app'));
registerServiceWorker();

And package.json

{
"name": "mailsender-client",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "^4.1.3",
"jquery": "^3.3.1",
"moment": "^2.22.2",
"query-string": "^6.5.2",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-router": "^3.2.1",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4"
},
"scripts": {
 "start": "react-scripts start",
 "build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
3
  • We are all gonna need some debugging information. Are you using create-react-app? Did you change index.js? And what does your package.json look like? Commented Jul 31, 2018 at 13:43
  • thank you for response, i find out error, need replace query-string with qs. github.com/facebook/create-react-app/issues/3734 Commented Jul 31, 2018 at 13:59
  • 2
    Great! Now you can post your solution to the problem as an answer, in order to close the question. :) Commented Jul 31, 2018 at 14:05

3 Answers 3

2

Try npm audit fix. This worked for me when I get dependency issues.

Sign up to request clarification or add additional context in comments.

Comments

1

In my case need replace dependency query-string with qs. For details see https://github.com/facebook/create-react-app/issues/3734

Comments

0

Also the problem may be caused by existing warnings.

I have such error during npm run build "Treating warnings as errors because process.env.CI = true. Most CI servers set it automatically. Failed to compile"

Get rid of warnings or set this variable to false

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.