ELIFECYCLE npm run-script build

triaged

(Rvernica) #1

What I Wanted to Do

> npm run-script build

What Happened Instead

/usr/src/.../setup # npm run-script build

> setup@0.1.0 build /usr/src/.../setup
> react-scripts build

Creating an optimized production build...
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! setup@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the setup@0.1.0 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!     /root/.npm/_logs/2019-01-17T20_28_47_563Z-debug.log

Here is the log file:

# cat /root/.npm/_logs/2019-01-17T20_28_47_563Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run-script', 'build' ]
2 info using npm@6.4.1
3 info using node@v8.14.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle setup@0.1.0~prebuild: setup@0.1.0
6 info lifecycle setup@0.1.0~build: setup@0.1.0
7 verbose lifecycle setup@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle setup@0.1.0~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/.../setup/node_modules/.bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle setup@0.1.0~build: CWD: /usr/src/.../setup
10 silly lifecycle setup@0.1.0~build: Args: [ '-c', 'react-scripts build' ]
11 silly lifecycle setup@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle setup@0.1.0~build: Failed to exec build script
13 verbose stack Error: setup@0.1.0 build: `react-scripts build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301: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/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:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid setup@0.1.0
15 verbose cwd /usr/src/.../setup
16 verbose Linux 3.10.0-957.1.3.el7.x86_64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run-script" "build"
18 verbose node v8.14.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error setup@0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the setup@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Details

I get this error when I try to run this command in a Docker container. It works fine outside the Docker container. It also works fine in a Docker container on a different machine (using the same Docker version and setup).

Platform Info

$ npm --versions
{ setup: '0.1.0',
  npm: '6.4.1',
  ares: '1.14.0',
  cldr: '32.0',
  http_parser: '2.8.1',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.33.0',
  node: '8.14.0',
  openssl: '1.0.2q',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.20.2',
  v8: '6.2.414.72',
  zlib: '1.2.11' }
$ node -p process.platform
linux

(Kat Marchán) #2

This is an issue with the script itself. See the above section of the error log.


(Rvernica) #3

Which section exactly are you referring to? Thanks!


(Kat Marchán) #4

This section right before the actual error message from npm.


(Rvernica) #5

I see. I don’t think it is a memory issue and no one called kill. So, it is a bit of a mystery why it works on one environment and not the other. I think it is a bug, or, at least, a poorly documented error.