Azure/azure-iot-pcs-device-simulation

Unable to execute npm run build - ELIFECYCLE error...?

Closed this issue · 2 comments

Type of issue

  • [ X] Bug
  • New feature
  • Enhancement

Description

After resolving the initial issue with the missing references in package-lock and package, ran with the following instructions: - delete dist, node_modules folder ; npm ci ; npm run build. The npm ci command ran successfully but the npm run build command failed with the following messages:
Latest state = Running
request to https://management.azure.com/subscriptions/..../operationStatuses/08585912064887750855?api-version=2020-06-01 failed, reason: getaddrinfo ENOTFOUND management.azure.com
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iot-device-simulation@1.0.0 deploy: npm run build && node ./dist/deploy.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iot-device-simulation@1.0.0 deploy 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:

I checked the Azure portal and an app registration had been created but it appeared to be the only resource created (I expected at least a resource group and a VM). I re-ran the command, this time I didn't get any error messages but I also didn't get any messages or dialogue to indicate anything ran. Re-running npm run build just appears to be a no-op:
PS C:\FastTrack\IoT Device Simulation\azure-iot-pcs-device-simulation\deployment> npm run build

iot-device-simulation@1.0.0 build C:\FastTrack\IoT Device Simulation\azure-iot-pcs-device-simulation\deployment
tsc
PS C:\FastTrack\IoT Device Simulation\azure-iot-pcs-device-simulation\deployment>

Again, there were no additional resources created in Azure and no dialogue or prompts to login. I deleted the AAD app registration and re-ran npm run build and still no dialogue to suggest the command is executing and no resources created in Azure.

Attached is the relevant log.
2021-01-11T21_31_27_202Z-debug.log
...

Steps to reproduce

I am not able to recreate the initial error message above.

Expected behavior

During execution, I expect prompts to login and when the script completes I expect Azure resources to be created including an app registration, resource group, a VM, and other IoT resources.

Context and Environment

Please try the following:

  • Delete the node_modules folder in the deployment directory
  • Delete the %userprofile%.iot-device-simulation directory
  • Delete the AAD app that was registered by the deployment script
  • cd to the deployment directory
  • npm install
  • npm run deploy

I also found this this discussion which might help.

I don't know if this is relevant or not, but I'm running npm 7.3.0

Please reactivate this issue if the steps above didn't resolve it for you.