0

Quick context of my problem.

I have an angular app that i want to get on a CI flow with Bamboo. When I am working on it locally (macOS High Sierra 10.13.5) everything is good.

But, when i run the build plan or when it triggers on repository changes, i this error in the deployment stage.

Error: Cannot find module 'cycle'

I've installed firebase with npm i firebase as instructed on https://www.npmjs.com/package/firebase

Version info

firebase: 5.3.0

npm: 6.2.0 (locally and on the CI)

Platform Information

Ubuntu 16.04

Steps to reproduce

any firebase command e.g firebase deploy --only hosting

Expected behavior

successful deployment

Actual behavior

internal/modules/cjs/loader.js:583 throw err; ^

Error: Cannot find module 'cycle'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/winston/lib/winston/common.js:11:13)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

This may be a duplicate of this question

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Simon k
  • 403
  • 1
  • 5
  • 17
  • Check your lockfiles and check if both you and the CI are using the same version of npm/yarn. – Lazar Ljubenović Aug 01 '18 at 09:02
  • Updated the question. Im not sure that the cycle package should be in package-lock file, since it seems to be a firebase cli related issue. – Simon k Aug 01 '18 at 09:17
  • Delete `node_modules`, delete `package-lock` and locally run `npm i` again. Then see if CI works. Make sure to commit the `package-lock` file as well. – Lazar Ljubenović Aug 01 '18 at 09:19
  • Considering that i it is a CI server, the node_modules and package-lock files does not exist until it pulls the repo, this would happen every time it runs the build plan (which includes npm i). It didn't change anything, still getting the same error – Simon k Aug 01 '18 at 09:27
  • No, the point of `package-lock` is to exist and make sure that you're getting the same dependencies. Read about what it does in npm docs. – Lazar Ljubenović Aug 01 '18 at 09:33
  • Okay, i might have thrown you off there. the package-lock file is committed and exists locally and on the CI. But my point is, that the CI cleans the source files between each build. Anyway, im no expert, will try your suggestion. – Simon k Aug 01 '18 at 09:39

0 Answers0