[SOLVED] Can't run app after meteor build

Hi

I’m trying to deploy app following https://guide.meteor.com/deployment.html#deployment-options

meteor --version
Meteor 1.10.1
node --version
v12.16.1
npm --version
6.14.4
meteor node --version
v12.16.1
meteor npm --version
6.14.0

I’m able run app with meteor --production --settings settings.json and it works well

but after meteor build and unpacking bundle I try to run it and got:

node main.js
internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'reify/lib/runtime'
Require stack:
- /home/username/app_name/build/bundle/programs/server/runtime.js
- /home/username/app_name/build/bundle/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> (/home/username/app_name/build/bundle/programs/server/runtime.js:10:3)
    at Object.<anonymous> (/home/username/app_name/build/bundle/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: [
    '/home/username/app_name/build/bundle/programs/server/runtime.js',
    '/home/username/app_name/build/bundle/main.js'
  ]
}

/bundle/programs/server folder contains:

.    assets             boot.js      debug.js       mini-files.js.map    npm-rebuild-args.js.map  npm-rebuilds.json   npm-shrinkwrap.json  profile.js      runtime.js      server-json.js.map
..   boot-utils.js      boot.js.map  debug.js.map   npm                  npm-rebuild.js           npm-require.js      package.json         profile.js.map  runtime.js.map
app  boot-utils.js.map  config.json  mini-files.js  npm-rebuild-args.js  npm-rebuild.js.map       npm-require.js.map  packages             program.json    server-json.js

tryed to build and run on windows 10 and on debian 9 - same error.

Solved by copying node_modules from /.meteor/local/build/programs/server

You should not need to do this.
Did you run npm install in bundle/programs/server after it had finished building?
This section from the docs:

cd my_build_bundle_directory
(cd programs/server && npm install)
1 Like