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
version of Nx used : 7.8.6
version of Angular CLI used : 7.3.1
angular.json configuration : default
version of Angular DevKit used : ~0.13.0
Reproduction steps:
create a new workspace using fullstack preset
build the api ng build api
remove the node_modules directory
run npm install --production
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.
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
angular.json
configuration : defaultReproduction steps:
ng build api
npm install --production
node ./dist/apps/api/main.js
Failure Logs
Other
When using
npm install
without the--production
option, it works fine. I installed manually thesource-map-support
module as a workaround.