NPM modules not found, circle2.0 migration issue


#1

I’m working on migrating from circle 1.0 to 2.0, and encountering the following NPM failure when trying to execute npm login early in the build setup.

#!/bin/bash -eo pipefail
npm login <<!
$NPM_USERNAME
$NPM_PASSWORD
$NPM_EMAIL
!
module.js:471
    throw err;
    ^

Error: Cannot find module 'core-util-is'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:44:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
Exited with code 1

I’m struggling to find leads on the cause of this issue. I’m using the same versions of node and NPM as on our circle 1.0 builds:

    docker:
      - image: circleci/node:6.10.1
      - image: circleci/ruby:2.3

Anyone have any suggestions or thoughts so I can continue to debug? I have already tried various other versions of node and NPM, and the issue is the same every time, except on different versions there are different modules that are not found. Thanks.


#2

Being pretty dumb!! Of course two separate docker images is not going to work here. I did not realize that there are ruby-node prebuilt images available publicly, and that has fixed my issue.


#3