Skip to content

Getting "Cannot find module 'zone.js/dist/zone-node'" when deploying on production server #330

Description

@tonihuang

Hi there,

Thank you for the great starter template!
I have been using it to create application and when i'm about to deploy to production server i get "Cannot find module 'zone.js/dist/zone-node'. The steps that i did was:

  1. yarn universal
  2. copy dist/ and dll/ folder to server
  3. Runnode dist/server.js
    The fuill stacktrace is as below
    Error: Cannot find module 'zone.js/dist/zone-node'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.zone.js/dist/zone-node (/var/.../myapp/dist/server.js:9138:18)
    at webpack_require (/var/.../myapp/dist/server.js:20:30)
    at Object. (/var/.../myapp/dist/server.js:8647:130)
    at Object../src/server.ts (/var/.../myapp/dist/server.js:8711:30)
    at webpack_require (/var/.../myapp/dist/server.js:20:30)
    at /var/.../myapp/dist/server.js:63:18

I can run it on the generated server.js in local but not on server. Any help will be appreciated. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions