How to fix issue on "ng" not recognized in azure kudu environment in azure while deploying an angular webapp thru jenkins deploy

Viewed 288

followed this article in creating an angular app to azure website. (https://passos.com.au/build-and-deploy-an-angular-app-from-github-to-azure-website/) but in my case, we used Jenkins to deploy it on the website. i used Jenkins plugin (Publish an Azure Web App).

Here is the error i get.

2019-01-10T05:32:25.3182021Z,The node.js application will run with the default node.js version 8.9.4.,,0
    2019-01-10T05:32:25.3338146Z,Selected npm version 5.6.0,,0
    2019-01-10T05:33:27.4200572Z,npm WARN @angular/animations@7.2.0 requires a peer of @angular/core@7.2.0 but none is installed. You must install peer dependencies yourself.,,1
    2019-01-10T05:33:27.4380331Z,up to date in 59.495s,,0
    2019-01-10T05:33:27.4380331Z,npm WARN angular-6-datatable@0.8.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.,,1
    2019-01-10T05:33:27.4513060Z,npm WARN angular-6-datatable@0.8.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.,,1
    2019-01-10T05:33:27.4689400Z,npm WARN angular-6-datatable@0.8.0 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.,,1
    2019-01-10T05:33:27.4988320Z,npm WARN The package @angular/cli is included as both a dev and production dependency.,,1
    2019-01-10T05:33:27.5138032Z,npm WARN The package @angular/compiler-cli is included as both a dev and production dependency.,,1
    2019-01-10T05:33:27.5138032Z,Building App in D:\home\site\repository…,,0
    2019-01-10T05:33:27.5294295Z,npm WARN The package typescript is included as both a dev and production dependency.,,1
    2019-01-10T05:33:27.5606827Z,npm WARN The package svg2sprite-cli is included as both a dev and production dependency.,,1
    2019-01-10T05:33:27.5763069Z,npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):,,1
    2019-01-10T05:33:27.6075585Z,npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"}),,1
    2019-01-10T05:33:27.6253798Z,,,1
    2019-01-10T05:33:29.2496514Z,,,0
    2019-01-10T05:33:29.2638549Z,> SB-Admin-BS4-Angular-7@7.0.0 build D:\home\site\repository,,0
    2019-01-10T05:33:29.2638549Z,> ng build --prod --aot,,0
    2019-01-10T05:33:29.2951058Z,,,0
    2019-01-10T05:33:29.4044879Z,'ng' is not recognized as an internal or external command,,,1
    2019-01-10T05:33:29.4201074Z,operable program or batch file.,,1
    2019-01-10T05:33:29.4513736Z,npm ERR! code ELIFECYCLE,,1
    2019-01-10T05:33:29.4669827Z,npm ERR! errno 1,,1
    2019-01-10T05:33:29.4826098Z,Failed exitCode=1, command="D:\Program Files (x86)\nodejs\8.9.4\node.exe" "D:\Program Files (x86)\npm\5.6.0\node_modules\npm\bin\npm-cli.js" run build,,0
    2019-01-10T05:33:29.4826098Z,npm ERR! SB-Admin-BS4-Angular-7@7.0.0 build: `ng build --prod --aot`,,1
    2019-01-10T05:33:29.4982327Z,An error has occurred during web site deployment.,,0
    2019-01-10T05:33:29.5151098Z,npm ERR! Exit status 1,,1
    2019-01-10T05:33:29.5294872Z,npm ERR! ,,1
    2019-01-10T05:33:29.5294872Z,npm ERR! Failed at the SB-Admin-BS4-Angular-7@7.0.0 build script.,,1
    2019-01-10T05:33:29.5607390Z,npm ERR! This is probably not a problem with npm. There is likely additional logging output above.,,1
    2019-01-10T05:33:29.5763692Z,,,1
    2019-01-10T05:33:29.5763692Z,npm ERR! A complete log of this run can be found in:,,1
    2019-01-10T05:33:29.5919898Z,npm ERR!     D:\local\AppData\npm-cache\_logs\2019-01-10T05_33_29_436Z-debug.log,,1
    2019-01-10T05:33:29.5919898Z,The system cannot find the drive specified.,,1
    2019-01-10T05:33:29.6232380Z,Missing server.js/app.js files, web.config is not generated\r\nnpm WARN @angular/animations@7.2.0 requires a peer of @angular/core@7.2.0 but none is installed. You must install peer dependencies yourself.\r\nnpm WARN angular-6-datatable@0.8.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.\r\nnpm WARN angular-6-datatable@0.8.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.\r\nnpm WARN angular-6-datatable@0.8.0 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.\r\nnpm WARN The package @angular/cli is included as both a dev and production dependency.\r\nnpm WARN The package @angular/compiler-cli is included as both a dev and production dependency.\r\nnpm WARN The package typescript is included as both a dev and production dependency.\r\nnpm WARN The package svg2sprite-cli is included as both a dev and production dependency.\r\nnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):\r\nnpm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})\r\n\r\n'ng' is not recognized as an internal or external command,\r\noperable program or batch file.\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! SB-Admin-BS4-Angular-7@7.0.0 build: `ng build --prod --aot`\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the SB-Admin-BS4-Angular-7@7.0.0 build script.\r\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR!     D:\local\AppData\npm-cache\_logs\2019-01-10T05_33_29_436Z-debug.log\r\nThe system cannot find the drive specified.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\79.11121.3655\bin\Scripts\starter.cmd deploy.cmd,,2
0 Answers
Related