Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

vercel/pkg Error with gpt-tokenizer #40

Open
Ranork opened this issue Nov 28, 2023 · 0 comments
Open

vercel/pkg Error with gpt-tokenizer #40

Ranork opened this issue Nov 28, 2023 · 0 comments

Comments

@Ranork
Copy link

Ranork commented Nov 28, 2023

When we use gpt-tokenizer pkg packageging fails.

The warning in build:

Warning Cannot find module 'gpt-tokenizer/model/gpt-3.5-turbo' from 'D:\****\explorer'  in D:\***\explorer.js
> Warning Cannot include file %1 into executable.
  The file must be distributed with executable as %2.
  %1: node_modules\open\xdg-open
  %2: path-to-executable/xdg-open
> Warning Cannot include file %1 into executable.
  The file must be distributed with executable as %2.
  %1: node_modules\open\xdg-open
  %2: path-to-executable/xdg-open

The error in execute:

Error: Cannot find module 'C:\snapshot\***\dist\main.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function._resolveFilename (pkg/prelude/bootstrap.js:1951:46)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.runMain (pkg/prelude/bootstrap.js:1979:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

The package.json:

{
  "name": "fileservice",
  "version": "1.0.0",
  "description": "File Service",
  "type": "module",
  "main": "src/main.js",
  "scripts": {
    "start": "babel-node src/main.js",
    "convert": "npx babel src -d dist",
    "package": "pkg ./dist/main.js -o dist-public/FileService --public-packages \"*\"",
    "build": "npm run convert && npm run package && ROBOCOPY .\\ .\\dist-public\\ .env"
  },
  "pkg": {
    "outputPath": "dist",
    "options": [
      "experimental-modules"
    ],
    "assets": [
      "node_modules/.prisma/client/*.node",
      "node_modules/axios/dist/node/axios.cjs",
      "node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node"
    ]
  },
  "keywords": [],
  "author": "Akatron Network",
  "license": "ISC",
  "dependencies": {
    "axios": "0.27.2",
    "babel-jest": "^29.6.4",
    "directory-tree": "^3.5.1",
    "dotenv": "^16.3.1",
    "form-data": "^4.0.0"
  },
  "devDependencies": {
    "@babel/cli": "^7.22.10",
    "@babel/core": "^7.22.11",
    "@babel/node": "^7.22.10",
    "@babel/preset-env": "^7.22.14",
    "@babel/register": "^7.22.5",
    "babel-plugin-module-resolver": "^5.0.0",
    "babel-plugin-transform-import-meta": "^2.2.1"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant