0

Have spent last 3 hours trying to get my reactjs project to build... have removed package.json / node-modules, rebuild using npm install. Had to rebuild all my scss links for some reason, finally have development server running fine, but when i run NPM RUN BUILD i get the following error...

> react-scripts build

Creating an optimized production build...
Failed to compile.

Parse error on line 1: 
^
Expecting "CALC", "LPAREN", "SUB", "NUMBER", "FUNCTION", "LENGTH", "ANGLE", "TIME", "FREQ", "RES", "EMS", "EXS", "CHS", "REMS", "VHS", "VWS", "VMINS", "VMAXS", "PERCENTAGE", "expression", "math_expression", "value", "function", "css_value", got unexpected end of input
CompileError: Begins at CSS selector undefined


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/grahams/.npm/_logs/2020-01-15T12_55_32_296Z-debug.log

and this is what the log fine outputs

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/grahams/Desktop/docker-apache-php5/htdocs/2020DotCom-2019-React/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
9 verbose lifecycle [email protected]~build: CWD: /Users/grahams/Desktop/docker-apache-php5/htdocs/2020DotCom-2019-React
10 silly lifecycle [email protected]~build: Args: [ '-c', 'react-scripts build' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
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:332: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)
14 verbose pkgid [email protected]
15 verbose cwd /Users/grahams/Desktop/docker-apache-php5/htdocs/2020DotCom-2019-React
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v8.11.3
19 verbose npm  v6.13.6
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `react-scripts build`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Can anyone advise as how to get project working...

3
  • try changing react-script version Commented Jan 15, 2020 at 13:48
  • Have tried this off your suggestion, upgraded react-scripts to latest v3.3.0 - no differnece Commented Jan 15, 2020 at 14:10
  • well you can create an empty project then build it, if that gives error, then there is some sort of problem in your system, else - you know what to do next, just move all files, drag and drop then build, give it a try... Commented Jan 15, 2020 at 14:12

1 Answer 1

1

There is a function called printBuildError in react-dev-utils. Modify this function to print out the stack trace (err.stack), and this will give you an idea of exactly what's not compiling.

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

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.