Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'azure-iot-device-mqtt' #1217

Closed
pbrane opened this issue Mar 13, 2024 · 3 comments
Closed

Error: Cannot find module 'azure-iot-device-mqtt' #1217

pbrane opened this issue Mar 13, 2024 · 3 comments
Labels

Comments

@pbrane
Copy link

pbrane commented Mar 13, 2024

- **OS and version used:** MacOS, Sonoma 14.3.1, Intel Processor
- **Node.js version:** 21.6.2
- **npm version:** 10.2.4
- **list of installed packages:** $ npm list
azure-iot-sdk-node@ /Users/david/development/src/molex/azure-iot-sdk-node
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
- **cloned repo:** 2020-08-18-228-ga85e2803

Description of the issue

I pulled the latest code while working through the Quickstart: Provision a simulated symmetric key device found here: https://learn.microsoft.com/en-us/azure/iot-dps/quick-create-simulated-device-symm-key?pivots=programming-language-nodejs

When I execute the command as described, get an error indicating it can't find a module:

$ node provisioning/device/samples/register_symkey.js
node:internal/modules/cjs/loader:1152
  throw err;
  ^

Error: Cannot find module 'azure-iot-device-mqtt'
Require stack:
- /Users/david/development/src/molex/azure-iot-sdk-node/provisioning/device/samples/register_symkey.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1149:15)
    at Module._load (node:internal/modules/cjs/loader:990:27)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/david/development/src/molex/azure-iot-sdk-node/provisioning/device/samples/register_symkey.js:6:23)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/david/development/src/molex/azure-iot-sdk-node/provisioning/device/samples/register_symkey.js'
  ]
}
@pbrane pbrane added the bug label Mar 13, 2024
@vishnureddy17
Copy link
Member

Can you try running npm install from the /provisioning/device/samples/ directory?

@pbrane
Copy link
Author

pbrane commented Mar 19, 2024

Can you try running npm install from the /provisioning/device/samples/ directory?

Thanks, but that generated 486 errors. Seems something isn't right with my build env. I'll keep digging.

@vishnureddy17
Copy link
Member

Closing due to inactivity. Feel free to re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants