summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-02-22 20:16:16 -0500
committerGitHub <noreply@github.com>2023-02-22 20:16:16 -0500
commitddc350780d6743be3794896e3987361df9f2cde7 (patch)
treef267d2756ddd7c1ffef8e4c080e0530e542aed3f /cli/worker.rs
parenta31d8869ea6c0651109523963a23f16101ce7e64 (diff)
fix(npm): resolve node_modules dir relative to package.json instead of cwd (#17885)
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index f8a9f54bb..000216102 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -304,7 +304,7 @@ impl CliMainWorker {
async fn initialize_main_module_for_node(&mut self) -> Result<(), AnyError> {
deno_node::initialize_runtime(
&mut self.worker.js_runtime,
- self.ps.options.node_modules_dir(),
+ self.ps.options.has_node_modules_dir(),
)
.await?;
if let DenoSubcommand::Run(flags) = self.ps.options.sub_command() {
@@ -631,7 +631,7 @@ fn create_web_worker_pre_execute_module_callback(
if ps.npm_resolver.has_packages() {
deno_node::initialize_runtime(
&mut worker.js_runtime,
- ps.options.node_modules_dir(),
+ ps.options.has_node_modules_dir(),
)
.await?;
}