问题标签 [zeit-pkg]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
220 浏览

zeit-pkg - zeit-pkg 生成的可执行文件需要分发哪些文件?

如果我使用 pkg ( https://github.com/zeit/pkg ) 构建一个 exe 文件,我还需要与 exe 一起分发哪些其他文件?

生成的 .exe 似乎包含 Node.js 二进制文件的副本。因此,我想到除了 .exe 之外我不应该包含一个 Node.js 许可证文件吗?或者,exe 中(内部)内置的版权和许可声明是否足够?

Node.js 是否有其他需要归属的开源组件?

或者可以单独分发 pkg 生成的 .exe 吗?有没有此类应用的示例?

0 投票
1 回答
90 浏览

arangodb - transaction code "require('@arangodb').db;" can't be packaged

zeit-pkg is a tool for package nodejs code. zeit-pkg also support require('arangojs'). But zeit-pkg returned error for meet const db = require('@arangodb').db; zeit-pkg returns error.

I want to know what's particular in require('@arangodb').db. It's whether any replacement method exists for writing transaction. Or any other package tools can support require('@arangodb').db;

0 投票
1 回答
442 浏览

node.js - 时代/pkg 错误!套接字超时

我正在尝试用zeit/pkg打包我的node项目。运行命令pkg后,我得到了这个错误:</p>

pkg@4.3.3 获取基本 Node.js 二进制文件到 PKG_CACHE_PATH

错误!ESOCKETTIMEDOUT 直接链接找不到资产:{"tag":"v2.5","name":"uploaded-v2.5-node-v10.4.1-win-x64"}

错误!套接字超时

0 投票
1 回答
2811 浏览

node.js - zeit/pkg 如何捆绑我的节点应用程序?

这是我关于 SO 的第一个问题,所以首先是一个 BIG HELLO,如果我的问题不符合所有标准或看起来很尴尬,请原谅。

我想知道我的应用程序是如何与 zeit 的 pkg 捆绑和编译的。

捆绑包是否插入到预先确定大小的二进制文件中?

它是否下载像 nexe 这样的节点源,并且代码是作为 main 运行的,还是在执行二进制文件时加载的快照?

我有一个后端 node-express 服务器和一个前端 Angular 应用程序,每个应用程序都有自己的 node_modules 文件夹,如下所示:

pkg 如何处理这两个 node_modules 实例?

非常感谢您的帮助/专业知识!

0 投票
0 回答
583 浏览

node.js - 使用 zeit/pkg 打包 Node-Red

我在 node-red 项目中使用zeit/pkg时遇到了一些问题。以下是复制问题的步骤:

  1. git clone https://github.com/node-red/node-red.git
  2. cd node-red
  3. npm install
  4. npm run build

  5. 在构建命令之后,我将以下内容添加到我的 package.json 文件中:

    /li>
  6. 运行命令pkg .

运行后pkg .出现以下错误:

在 pkg 命令之后运行 exe 会给我这个错误: Node-RED has not been built. See README.md for details

任何帮助将不胜感激。这似乎是一个简单的路径问题,但我似乎无法让它工作。

0 投票
1 回答
1465 浏览

next.js - 尝试使用“pkg”构建“nextjs”应用程序会导致依赖错误和/或构建后出现 404 错误

我正在尝试使用zeit/pkg基于此处的示例构建一个小型 NextJS 示例应用程序的可执行文件。问题是唯一可行的入口点(server.js)似乎给了我一堆错误,目前没有在他们与 webpack 编译相关的问题中列出。

如果您想复制,只需按照此处的说明进行操作,然后添加 pkg。另外 - 这是下面的错误输出。

错误无法编译,出现 2 个错误
10:48:35 AM 未找到这些依赖项:

  • @babel/runtime/helpers/在 D:/snapshot/pkg-ssr/node_modules/next/dist/lib/app.js 中扩展
  • webpack-hot-middleware/client?autoConnect=false&overlay=false&reload=true 在 D:/snapshot/pkg-ssr/node_modules/next/dist/client/webpack-hot-middleware-client.js

要安装它们,你可以运行: npm install --save @babel/runtime/helpers/extends webpack-hot-middleware/client?autoConnect=false&overlay=false&reload=true (node:15964) DeprecationWarning: Module.chunks: Use Module。 forEachChunk/mapChunks/getNumberOfChunks/isInChunk/addChunk/removeChunk

准备好http://localhost:3000客户端 ping,但页面没有条目:/about { 错误:在 Function.Module._resolveFilename (internal/modules/cjs/loader. js:592:15) 在 Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1278:46) 在 Function.Module._load (internal/modules/cjs/loader.js:518:25) 在 Module.require (internal/modules/cjs/loader.js:648:17) 在 Module.require (pkg/prelude/bootstrap.js:1157:31) 在 require (internal/modules/cjs/helpers.js:20:18) 在_callee3$ (D:\snapshot\pkg-ssr\node_modules\next\dist\server\render.js:202:29) 在 tryCatch (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js: 62:40) 在 Generator.invoke [as _invoke] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:296:22) 在 Generator.forEach.prototype.(anonymous function) [as next] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:114:21) 在步骤 (D:\snapshot \pkg-ssr\node_modules\@babel\runtime\helpers\asyncToGenerator.js:12:30) 在 _next (D:\snapshot\pkg-ssr\node_modules\@babel\runtime\helpers\asyncToGenerator.js:27:9 ) 在 process._tickCallback (internal/process/next_tick.js:68:7) 代码:'MODULE_NOT_FOUND'} 客户端 ping,但页面没有条目:/about { 错误:找不到模块 'D:_experiments\pkg-ssr .next\build-manifest.json' 在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:592:15) 在 Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1278:46) 在模块中的 Function.Module._load (internal/modules/cjs/loader.js:518:25)。需要 (internal/modules/cjs/loader.js:648:17) 在 Module.require (pkg/prelude/bootstrap.js:1157:31) 在 require (internal/modules/cjs/helpers.js:20:18)在 _callee3$ (D:\snapshot\pkg-ssr\node_modules\next\dist\server\render.js:202:29) 在 tryCatch (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js :62:40) 在 Generator.invoke [as _invoke] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:296:22) 在 Generator.forEach.prototype.(匿名函数) [as下一步] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:114:21) 在步骤 (D:\snapshot\pkg-ssr\node_modules\@babel\runtime\helpers\asyncToGenerator.js :12:30) 在 _next (D:\snapshot\pkg-ssr\node_modules\@babel\runtime\helpers\asyncToGenerator.js:27:9) 在进程中。_tickCallback (internal/process/next_tick.js:68:7) 代码:'MODULE_NOT_FOUND' }

0 投票
1 回答
140 浏览

feathersjs - 将 PKG 与 featherjs 应用程序一起使用

有没有人尝试过使用pkgwith featherjs?我很难让它工作。

运行可执行文件时出现以下错误:

如果有人有任何指导,不知道从哪里开始。

0 投票
2 回答
1983 浏览

javascript - Node.js - 使用 PKG 创建可执行文件

我在 node.js 中有一个应用程序,现在我正在尝试创建一个可执行文件以在没有所有项目文件的情况下运行该应用程序,但是当我尝试使用时遇到问题pkghttps://github.com/zeit/pkg#detecting -assets-in-source-code)。

package.json我添加这个:

},

在控制台中我运行这个命令并且我在这个过程中没有任何错误并创建3个平台可执行文件,pkg index.js --output

当我运行可执行文件时,它开始时没有错误,当我访问浏览器时,它返回此错误:

在 index.js 我有这一行来访问视图文件夹:

我该如何解决这种情况?

谢谢

0 投票
1 回答
1624 浏览

node.js - 如何使节点项目可执行?

我在 node.js 和 express.js 中有我的项目。我需要制作 node.js 项目的可执行文件。

项目配置:

使用 ES6 特性:导入和动态导入,对于这个 babel.js,我正在使用。

项目状态:

项目运行正常没问题。

项目的转译正在工作。那就是捆绑创建是可以的。

问题/错误/问题:

使用命令打包时:

包。--调试

它给出了“导入”错误

package.json 配置:

webapck.config.js :

我得到的错误:

会是什么原因??

有人可以提出一些建议或策略吗?

问候

0 投票
0 回答
660 浏览

node.js - 使用 zeit 的 pkg 打包 typescript 应用程序(找不到 lib.d.ts)

我正在尝试使用pkg编译为.js使用 typescript compiler的 zeit 打包一个 typescript 应用程序tsc。该软件包似乎没有任何问题创建,但是当我尝试运行 exe 时出现错误:

所以我将每个.d.ts文件添加为资产package.json

...但这没有用。

任何人都知道为什么即使打包后也找不到文件?我已验证,--debug并将其列为已打包。

感谢!