[solved] Error: Cannot find module 'reify/lib/runtime'

I’m trying to upgrade from 1.7.0.1 to 1.10.2 and at the same time upgrade from ubuntu 16.04 to 20.04 (probably not relevant).

I deploy by using

meteor build ../.build --directory --architecture=os.linux.x86_64

Then I rsync the build folder to the server and run it which has been working for ~4years

I’m getting this error

=> Starting meteor app on port:80
internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'reify/lib/runtime'
Require stack:
- /built_app/programs/server/runtime.js
- /built_app/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/built_app/programs/server/runtime.js:10:3)
    at Object.<anonymous> (/built_app/programs/server/runtime.js:53:3)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/built_app/programs/server/runtime.js', '/built_app/main.js' ]
}

My dependencies are only

  "dependencies": {
    "@babel/runtime": "^7.10.2",
    "bcrypt": "^4.0.1"
  }

Both are there because meteor demanded them. If I run without either it tells me to add them.

There are no devDependencies. I’ve deleted node_modules locally and then meteor npm install and things work locally. I don’t have any deps installed globally

I’m running it inside a docker container using Docker Hub node-12-base

I’m kind of at a loss for what else to try. I tried adding reify manually as a dependency but that didn’t help (removed it after trying).

Any other ideas what I’m doing wrong?

Figured it out. For some reason I didn’t use to have to npm install inside the buindle but now apparently I do.

Hi, did you found why reify is required and why is not installed during the build? I need always on server run npm install after build.

Thx a lot.

@greggman Do you mean the problem happened because you had npm install running on the server?
I am having this issue while setting up meteor on an AWS Linux 2.
Any tip you can fire my way would be highly appreciated :pray:

@tivoni @greggman

Building works for me with this kind of build script:

1 Like