Getting a weird EINVAL error with npm on CircleCI 2.0


#1

Installing node modules (package.json)
npm WARN The package axios is included as both a dev and production dependency.
npm WARN The package babel-cli is included as both a dev and production dependency.
npm WARN The package babel-preset-binded is included as both a dev and production dependency.
npm WARN The package concat-stream is included as both a dev and production dependency.
npm WARN The package kitchenfile is included as both a dev and production dependency.
npm WARN The package rimraf is included as both a dev and production dependency.
npm WARN The package string-to-stream is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: acorn-globals@3.1.0 (node_modules/acorn-globals):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: EINVAL: invalid argument, chown '/ci/project/node_modules/.staging/acorn-globals-dccb51c8’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy@1.0.2 (node_modules/wrappy):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, chmod '/ci/project/node_modules/.staging/wrappy-0b460bf1/LICENSE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: window-size@0.1.0 (node_modules/window-size):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, chown '/ci/project/node_modules/.staging/window-size-a1f2d062/package.json’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: acorn@3.3.0 (node_modules/acorn):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/ci/project/node_modules/.staging/acorn-d9f62e35/.gitattributes’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: are-we-there-yet@1.1.4 (node_modules/are-we-there-yet):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/ci/project/node_modules/.staging/are-we-there-yet-bf9fea1b/CHANGES.md’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist@2.1.2 (node_modules/yallist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/ci/project/node_modules/.staging/yallist-6f57f23a/iterator.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yargs-parser@2.4.1 (node_modules/yargs-parser):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/ci/project/node_modules/.staging/yargs-parser-fe59db6f/CHANGELOG.md’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: write@0.2.1 (node_modules/write):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/ci/project/node_modules/.staging/write-f42c2003/index.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: word-wrap@1.2.2 (node_modules/word-wrap):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/ci/project/node_modules/.staging/word-wrap-723f5aec/LICENSE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @semantic-release/error@1.0.0 (node_modules/@semantic-release/error):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, chmod '/ci/project/node_modules/.staging/@semantic-release/error-16cf8f2b/README.md’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: generic-pool@2.4.2 (node_modules/advisory-lock/node_modules/generic-pool):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime '/ci/project/node_modules/.staging/generic-pool-135df80b/lib/generic-pool.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ajv-keywords@1.5.1 (node_modules/ajv-keywords):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime '/ci/project/node_modules/.staging/ajv-keywords-09da0e05/keywords/formatMinimum.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @semantic-release/condition-travis@4.1.4 (node_modules/@semantic-release/condition-travis):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, chmod '/ci/project/node_modules/.staging/@semantic-release/condition-travis-7a2b37c8/README.md’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @semantic-release/commit-analyzer@2.0.0 (node_modules/@semantic-release/commit-analyzer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/ci/project/node_modules/.staging/@semantic-release/commit-analyzer-7e19c643/.npmignore’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi@0.3.1 (node_modules/ansi):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, chown '/ci/project/node_modules/.staging/ansi-f0e24749/examples/clear/index.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: async@1.0.0 (node_modules/async):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime '/ci/project/node_modules/.staging/async-77692f63/lib/async.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: asn1@0.2.3 (node_modules/asn1):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime '/ci/project/node_modules/.staging/asn1-80532028/lib/ber/reader.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: apparatus@0.0.9 (node_modules/apparatus):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime '/ci/project/node_modules/.staging/apparatus-9a98a48f/lib/apparatus/classifier/logistic_regression_classifier.js’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: acorn@4.0.13 (node_modules/acorn-globals/node_modules/acorn):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime ‘/ci/project/node_modules/.staging/acorn-7a8d946c/dist/acorn.es.js’

npm ERR! path /ci/project/node_modules/.staging/winston-81b2de90
npm ERR! code EINVAL
npm ERR! errno -22
npm ERR! syscall chown
npm ERR! EINVAL: invalid argument, chown ‘/ci/project/node_modules/.staging/winston-81b2de90’

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-06-16T17_58_08_634Z-debug.log
Exited with code 234

I was wondering if anyone had a similar issue. I can build locally successfully using circleci build. I suspect it has to do with the storage engine that CircleCI’s docker uses.


#2

There’s not much info to go off here, but I’m assuming this is npm5 and this is a known issue with other Discuss posts about it. We do not have a fix at this time, other than using a different version of npm or just using yarn.


#3

Thanks for the quick reply. It was indeed npm@5. Are you waiting for a fix by npm or is it an issue on your end?

edit: Looks like it might be related to https://github.com/npm/npm/issues/16896


#4

Whichever comes first :slight_smile: Probably npm. Seems specific to npm5 in Docker (like you linked).


#5

I’m a bit confused: why is it working when I run it locally using Docker but not on CI with the same setup?


#6

FWIW, NPM 5.0.4 is now released, which seems to have fixed this.

However, that now exposes a different NPM/Docker/Circle issue - Building of Docker images based upon 8.0.


#7

FWIW, another Circle-specific NPM issue now that 5.1.0 is out: https://github.com/npm/npm/issues/17658.


#8

@rohara - I’ve just learnt that NPM automatically closes untriaged/inactive bug reports after a certain period (see e.g. https://github.com/npm/npm/issues/17301#issuecomment-314270975).

I’m concerned that this means we’re going to be stuck in limbo forever. There are several showstoppers with using NPM 5 with CircleCI 2.0 (I can post all the links if you like, but I’m guessing you guys are tracking them :).
But fixing (or in some cases even engaging with) CI-related issues appears not to be high on the NPM team’s priority list.

Whilst I appreciate this is likely not on the Circle team to fix, do you have thoughts on how we (the community) can gain traction here to unblock this?

Some thoughts:

  • Consolidate all the NPM5-related issues into an uber-discussion.
  • Does the Circle team have inside contacts within the NPM team?

#9

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.