Our mission is to make cloud computing as easy and accessible as mobile computing. You can find our Next.js community here.


Deploying an Angular 9 application with private, scoped npm modules failes

February 18, 2020 at 8:44pm

Deploying an Angular 9 application with private, scoped npm modules failes

February 18, 2020 at 8:44pm

Hi folks, I'm new to so I hope this is the right place to ask for help.

I'm currently having problems deploying our Angular 9 application via now. In one component I'm importing our private npm packages and those are the reasons why it can not build the application when trying to deploy it. Locally on my computer it works fine.

I have set an NPM_TOKEN in the now.json and I did create a secret via now CLI. So it seems to be installing the private modules because there is no error in the logs when npm install is executed.

But when building the app with ng build --prod --aot --configuration=staging there's some TypeScript errors occurring which do not really make sense to me:

added 1376 packages from 1111 contributors in 23.703s
> pedics-webapp@0.0.0 build-staging /zeit/f6488c6
> ng build --prod --aot --configuration=staging
Compiling @angular/core : es2015 as esm2015
Compiling @angular/material/autocomplete : es2015 as esm2015
ERROR in src/app/platform/shared/pressure-canvas/pressure-canvas.component.ts:9:33 - error TS2307: Cannot find module '@pedics/sensor-client-pressure-viewer'.
9 import * as PressureViewer from '@pedics/sensor-client-pressure-viewer';
src/app/platform/shared/pressure-canvas/pressure-canvas.component.ts:10:38 - error TS2307: Cannot find module '@pedics/sensor-client-pressure-video-player'.
10 import * as PressureVideoPlayer from '@pedics/sensor-client-pressure-video-player';
src/app/platform/shared/pressure-canvas/pressure-canvas.component.ts:12:46 - error TS2307: Cannot find module '@pedics/sensor-client-pressure-video-edit'.
12 import { createEditableVideoFromVideo } from '@pedics/sensor-client-pressure-video-edit';
src/app/platform/shared/pressure-canvas/pressure-canvas.component.ts:13:24 - error TS2307: Cannot find module '@pedics/sensor-client-pressure-viewer'.
13 import { Viewer } from '@pedics/sensor-client-pressure-viewer';
npm ERR! errno 1
npm ERR! pedics-webapp@0.0.0 build-staging: `ng build --prod --aot --configuration=staging`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pedics-webapp@0.0.0 build-staging script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /zeit/.npm/_logs/2020-02-18T20_26_52_110Z-debug.log
Error: Exited with 1
at ChildProcess.<anonymous> (/zeit/72d2a711565ce413/.build-utils/.builder/node_modules/@now/static-build/dist/index.js:33891:24)
at ChildProcess.emit (events.js:210:5)
at ChildProcess.EventEmitter.emit (domain.js:475:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
worker exited with code 20 and signal null
Done with "package.json"

February 20, 2020 at 9:58pm

Anyone has an idea? This keeps me from using now on our project :(

  • reply
  • like