Open imfing opened 1 day ago
seem that the issue is caused by the assumption that all npm modules are located in <root_dir>/<registry_host>/...
in reality, the cached packages are actually stored in subdirectories, specifically under <root_dir>/<registry_host>/sub/path/...
Version: Deno 2.0.3
I have encountered this issue while working with a custom npm registry such as JFrog npm-registry. While Deno successfully caches, and executes scripts respecting the
NPM_CONFIG_REGISTRY
environment variable, compiling the script into an executable results in anERR_MODULE_NOT_FOUND
error for npm modules.Steps to reproduce
the example was taken from the blog post, I was running Deno 2.0.3 in blank GitHub codespace (Linux), with custom public npm registry mirror:
Screenshot:
Additional info:
I found that using custom npm registry like
$ export NPM_CONFIG_REGISTRY=http://registry.npm.taobao.org
would work without issues. This leads me to suspect that the problem may be related to how Deno compile handles npm modules located under a subpath (e.g.http://custom-registry.com/path/to/npm/
)