You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Deno打包(vendored)后的离线生产环境应用仍请求npm registry的问题求助

Deno打包(vendored)后的离线生产环境应用仍请求npm registry的问题求助

大家好,我最近碰到个头疼的问题,想请各位大佬帮忙看看:

我的Deno应用里用到了npm的依赖,导入代码是这样的:

import { 
    ServiceProvider, 
    ServiceProviderInstance , 
    IdentityProvider, 
    IdentityProviderInstance,
    setSchemaValidator } from 'npm:samlify@2.8.10';

我已经用vendor命令把依赖都打包到本地了,生成的deno.jsonc配置如下:

{
  "tasks": {
    "start": "deno run --allow-all src/server/main.ts --production"
  },
  "nodeModulesDir": true,
  "importMap": "./vendor/import_map.json"
}

但把应用部署到完全没联网的生产环境后,运行起来却报了这个错误:

error: Uncaught (in promise) TypeError: Error getting response at https://registry.npmjs.org/samlify for package "samlify": error sending request for url (https://registry.npmjs.org/samlify): error trying to connect: dns error: No such host is kno...

按说vendor之后所有依赖都应该被打包到本地了,为啥离线环境下还会去请求npm的registry呢?有没有大佬知道问题出在哪,该怎么解决?

备注:内容来源于stack exchange,提问作者lviggiani

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 12:43:15