0

I am trying to configure Azure CI/CD for Angular project

Below is screenshot of azure pipeline : enter image description here

Package.json

enter image description here

Build Project throws following error:

2019-05-20T09:19:18.0252202Z > ng build
2019-05-20T09:19:18.0252697Z     ^
2019-05-20T09:19:18.0253091Z 
2019-05-20T09:19:18.0253456Z 
2019-05-20T09:19:18.0254242Z Error: Cannot find module '../internal/operators/audit'
2019-05-20T09:19:18.0254971Z     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-05-20T09:19:18.0255650Z     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-05-20T09:19:18.0256280Z     at Module.require (internal/modules/cjs/loader.js:637:17)
2019-05-20T09:19:18.0257011Z     at require (internal/modules/cjs/helpers.js:22:18)
2019-05-20T09:19:18.0257814Z     at Object.<anonymous> (D:\a\1\s\IoTConnectAI\node_modules\@angular-devkit\schematics\node_modules\rxjs\operators\index.js:3:15)
2019-05-20T09:19:18.0258514Z     at Module._compile (internal/modules/cjs/loader.js:701:30)
2019-05-20T09:19:18.0259140Z     at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
2019-05-20T09:19:18.0259776Z     at Module.load (internal/modules/cjs/loader.js:600:32)
2019-05-20T09:19:18.0260390Z     at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
2019-05-20T09:19:18.0264689Z     at Function.Module._load (internal/modules/cjs/loader.js:531:3)
2019-05-20T09:19:18.0265336Z npm ERR! code ELIFECYCLE
2019-05-20T09:19:18.0265959Z npm ERR! errno 1
2019-05-20T09:19:18.0266569Z npm ERR! sconnectai@0.0.0 build: `ng build`
2019-05-20T09:19:18.0267438Z npm ERR! Exit status 1
2019-05-20T09:19:18.0268063Z npm ERR! 
2019-05-20T09:19:18.0268686Z npm ERR! Failed at the sconnectai@0.0.0 build script.
2019-05-20T09:19:18.0270422Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-05-20T09:19:18.0271137Z 

Tried ng build --prod

enter image description here

please help me to fix this

Sagar Modi
  • 770
  • 2
  • 7
  • 29
  • The error message is *Cannot find module '../internal/operators/audit'*. Did you investigate that error? – Daniel Mann May 20 '19 at 14:29
  • @DanielMann Yes, I have investigated error but not found any solution for this. When i build same code on my local machine its build successfully so i am not sure whats going wrong on azure devops. – Sagar Modi May 21 '19 at 05:08
  • @DanielMann I am getting above error when i add package "rxjs": "^6.5.1" in package.json – Sagar Modi May 21 '19 at 11:57

1 Answers1

0

Root cause of the issue trying to build project using npm command npm run build

ng build was not working and giving error of no such command because of trying from npm tool.

Add Command line task in Azure DevOps pipeline and build project using ng build enter image description here

It works fine and successfully build the project

Sagar Modi
  • 770
  • 2
  • 7
  • 29