Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(npmrc): skip loading .npmrc in home dir on permission error #24758

Merged
merged 3 commits into from
Jul 27, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Jul 26, 2024

Not sure how we can write a test for this. I just did one manually:

$ deno run test.ts
error: Error loading .npmrc at /home/david/.npmrc. Permission denied (os error 13)
$ ./target/debug/deno --log-level=debug run test.ts
DEBUG RS - deno::args:597 - Skipping .npmrc in home directory due to permission denied error. Error loading .npmrc at /home/david/.npmrc.
DEBUG RS - deno::args:608 - No .npmrc file found
DEBUG RS - deno::args:893 - Finished config loading.
DEBUG RS - deno::cache::cache_db:168 - Opening cache /home/david/.cache/deno/dep_analysis_cache_v2...
DEBUG RS - deno::cache::cache_db:168 - Opening cache /home/david/.cache/deno/node_analysis_cache_v2...
DEBUG RS - deno::cache::cache_db:168 - Opening cache /home/david/.cache/deno/v8_code_cache_v2...
DEBUG RS - deno::js:10 - Deno isolate init with snapshots.
DEBUG RS - deno::worker:183 - main_module file:///home/david/dev/deno/test.ts
DEBUG RS - deno::module_loader:158 - Preparing module load.
DEBUG RS - deno::module_loader:162 - Building module graph.
DEBUG RS - deno::file_fetcher:573 - FileFetcher::fetch_no_follow_with_options - specifier: file:///home/david/dev/deno/test.ts
DEBUG RS - deno::module_loader:208 - Prepared module load.
DEBUG RS - deno::module_loader:397 - V8 code cache hit for ES module: file:///home/david/dev/deno/test.ts, [16714255213963120801]
DEBUG RS - deno_runtime::worker:739 - received module evaluate Ok(
    (),
)

Closes #24734

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dsherret dsherret merged commit 086fa28 into denoland:main Jul 27, 2024
17 checks passed
@dsherret dsherret deleted the fix_permission_home_dir_npm_rc branch July 27, 2024 13:04
crowlKats pushed a commit that referenced this pull request Jul 31, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not surface permission denied errors for .npmrc in home directory
2 participants