Unable to get localhost certificate path using the %userprofile% in angular.json file

Viewed 48

I am trying to attach the cert and key when running npm start

But I couldn't able to get the current user folder path using %userprofile%

Getting error

Generating browser application bundles (phase: setup)...(node:8688) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'address' of undefined at F:\Project\AngularApp\node_modules@angular-devkit\build-webpack\src\webpack-dev-server\index.js:79:46
(Use node --trace-warnings ... to show where the warning was created) (node:8688) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:8688) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

In my Anguar.json file I have made changes like this.,

"serve": {
    ***,
    "options": {
    "browserTarget": "EmailAddIn:build:development",
    "ssl": true,
    "sslKey": "%userprofile%//.office-addin-dev-certs//localhost.key",
    "sslCert": "%userprofile%//.office-addin-dev-certs//localhost.crt"
}

If I move localhost.key & localhost.cert to project direct and run commands like ng serve --ssl --ssl-key .\\ssl\\localhost.key --ssl-cert .\\ssl\\localhost.crt then everything work fine but issues is everyone who working with me are need to do manually configured

Please help me to short out these issues.

Thanks.

0 Answers
Related