Nyalab / caniuse-api

request the caniuse data to check browsers compatibilities
MIT License
356 stars 27 forks source link

Postinstall error? #37

Closed ir-fuel closed 8 years ago

ir-fuel commented 8 years ago

I run npm install in my node Docker container and I get this in the output logs:

> caniuse-api@1.4.1 postinstall /var/www/node_modules/caniuse-api
> node generator.js

The command '/bin/sh -c npm install' returned a non-zero code: 1

Mind you, I don't explicitly depend on this package. I have no idea which package is responsible for downloading it.

Is there a way of figuring out what's going on? I am no npm expert by any means so any options that could show me more details are more than welcome.

FYI

npm info using npm@3.5.3
npm info using node@v4.2.2
MoOx commented 8 years ago

Can you do the following:

$ cd node_modules/caniuse-api
$ npm run postinstall

And past the output here?

ir-fuel commented 8 years ago

Hi

I upgraded the docker image I used to the latest version of node 4 (4.2.4) and I updated npm to the latest version too and the problem is no longer showing up in my build process. I'll close this for now.

jephir commented 8 years ago

I had this same error when running in Docker. In my case it was caused by not having enough free memory on the Docker host. I solved the problem by just stopping unneeded Docker containers. Partial npm-debug.log:

58232 silly postinstall caniuse-api@1.4.1 /data/node_modules/.staging/caniuse-api-b43c6555
58233 info lifecycle caniuse-api@1.4.1~postinstall: caniuse-api@1.4.1
58234 verbose lifecycle caniuse-api@1.4.1~postinstall: unsafe-perm in lifecycle false
58235 verbose lifecycle caniuse-api@1.4.1~postinstall: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/data/node_modules/caniuse-api/node_modules/.bin:/data/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
58236 verbose lifecycle caniuse-api@1.4.1~postinstall: CWD: /data/node_modules/caniuse-api
58237 silly lifecycle caniuse-api@1.4.1~postinstall: Args: [ '-c', 'node generator.js' ]
58238 verbose stack Error: spawn ENOMEM
58238 verbose stack     at exports._errnoException (util.js:856:11)
58238 verbose stack     at ChildProcess.spawn (internal/child_process.js:298:11)
58238 verbose stack     at exports.spawn (child_process.js:362:9)
58238 verbose stack     at spawn (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:7:13)
58238 verbose stack     at runCmd_ (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:224:14)
58238 verbose stack     at /usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:186:7
58238 verbose stack     at nextTickCallbackWith0Args (node.js:453:9)
58238 verbose stack     at process._tickCallback (node.js:382:13)
58239 verbose cwd /data
58240 error Linux 3.13.0-74-generic
58241 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
58242 error node v5.6.0
58243 error npm  v3.6.0
58244 error code ENOMEM
58245 error errno ENOMEM
58246 error syscall spawn
58247 error spawn ENOMEM
58248 error If you need help, you may report this error at:
58248 error     <https://github.com/npm/npm/issues>
58249 verbose exit [ 1, true ]
Nyalab commented 8 years ago

thanks for the information :+1: