nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.51k stars 2.34k forks source link

Missing source-map-support dependency when building node app for production #1495

Closed ibenjelloun closed 5 years ago

ibenjelloun commented 5 years ago

Expected Behavior

Running a node app build with only the production dependencies should success.

Current Behavior

When running a node app build after an npm install --production, the start fails.

Context

Reproduction steps:

  1. create a new workspace using fullstack preset
  2. build the api ng build api
  3. remove the node_modules directory
  4. run npm install --production
  5. run the api build node ./dist/apps/api/main.js

Failure Logs

$ node ./dist/apps/api/main.js
internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module 'source-map-support'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (D:\github\chat-room\dist\apps\api\main.js:1:63)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Other

When using npm install without the --production option, it works fine. I installed manually the source-map-support module as a workaround.

FrozenPandaz commented 5 years ago

A fix is available in 8.0.0. You can update with yarn update.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.