Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

build: Move reflect-metadata & express from devDependencies to dependencies #635

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

dbartel
Copy link
Contributor

@dbartel dbartel commented Sep 6, 2018

This fixes an issue I ran into while proving out a production-ready environment for hosting a Universal app. I noticed some devDependencies modules are required to be installed in order to run the application, which should not be the case.

Changes in a nutshell: Moves express and reflect-metadata from devDependencies to run dependencies.

Steps to reproduce issue

  1. Clone repo, run npm install
  2. Build project with npm run build:ssr
  3. Remove node_modules
  4. Run npm install --production to install run-time modules
  5. Run node dist/server

Following these steps, the node server will crash on launch due to missing dependencies:

> node dist/server
    throw err;
    ^
Error: Cannot find module 'reflect-metadata'
    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> (/home/dbartel/projects/ext/universal-starter/dist/server.js:4:1)
    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)

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@dbartel
Copy link
Contributor Author

dbartel commented Sep 6, 2018

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@CaerusKaru CaerusKaru merged commit 2b70e94 into angular:master Oct 18, 2018
CaerusKaru added a commit that referenced this pull request Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants