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

Cannot find module 'node:os' in @azure/logger dependency of @azure/identity #29569

Closed
1 of 6 tasks
rithvikp1998 opened this issue May 3, 2024 · 8 comments
Closed
1 of 6 tasks
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@rithvikp1998
Copy link

  • Package Name: @azure/identity
  • Package Version: ^4.2.0
  • Operating system: Ubuntu
  • nodejs
    • version: 20.x
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
Using the latest version of @azure/identity in node js code is breaking with the error: Cannot find module 'node:os'. From the stack trace it looks like the bug is coming from dependency of the identity package on @azure/logger package. Full stack trace:

##[error]Error: Cannot find module 'node:os'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (.<redacted>/node_modules/@azure/logger/dist/commonjs/log.js:7:19)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

To Reproduce
Steps to reproduce the behavior:

  1. Add the following dependency in package.json:
"dependencies": {
    ...
    "@azure/identity": "^4.2.0",
    ...
}

Expected behavior
Package should work without failing

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 3, 2024
Copy link

github-actions bot commented May 3, 2024

@KarishmaGhiya @maorleger

Copy link

github-actions bot commented May 3, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@maorleger
Copy link
Member

Hiya @rithvikp1998 - thanks for reaching out!

I tried to reproduce this on Node 20 and have been unable to.

Here's what I did (condensed to a small one-liner for copy-pasteability):

mkdir nodeostest && cd $_ && npm init -y && npm i @azure/identity && echo 'const identity = require("@azure/identity"); console.log("node version", process.version);'  > index.js && node index.js

I see that it successfully loaded identity and it prints out node version v20.10.0

Are you sure you are using node 20? Could you try this snippet out and see if it works for you? If it fails, could you tell me what is the output of running node --version ?

Thanks so much!

@maorleger maorleger added the needs-author-feedback More information is needed from author to address the issue. label May 3, 2024
@maorleger maorleger assigned maorleger and unassigned KarishmaGhiya May 3, 2024
Copy link

github-actions bot commented May 3, 2024

Hi @rithvikp1998. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label May 3, 2024
@rithvikp1998
Copy link
Author

Thanks for looking into it! I tested the command you gave, and it is working in my local machine with Node 20. So, I retried running it in our ADO pipeline and weirdly it is still failing with the same error. The Node install task in the pipeline is claiming it successfully installed Node 20 before running our code, but maybe there is something going wrong in it. I'll log the node version in the pipeline and see what version is getting installed.

@github-actions github-actions bot added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels May 8, 2024
@maorleger
Copy link
Member

Sounds good - going to mark this resolved for now but feel free to unresolve if you still suspect an issue with the SDK

@maorleger maorleger added the issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. label May 13, 2024
Copy link

Hi @rithvikp1998. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label May 13, 2024
Copy link

Hi @rithvikp1998, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Development

No branches or pull requests

3 participants