vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.32k stars 1.01k forks source link

Error: Cannot find module './functions/rsort' #1432

Closed OrrLumigo closed 2 years ago

OrrLumigo commented 2 years ago

What version of pkg are you using?

@5.3.2

What version of Node.js are you using?

12.22.1

What operating system are you using?

linux

What CPU architecture are you using?

x86_64

What Node versions, OSs and CPU architectures are you building for?

"node14-linux-x64"

Describe the Bug

i am running the script:

  npm i -g pkg@5.3.2
  pkg .

this is the package.json:

{
  "name": "lumigo-tracer-extension",
  "version": "0.1.0",
  "main": "dist/index.ts",
  "license": "MIT",
  "scripts": {
    "build": "rm -rf dist && tsc --build --force",
    "lint": "eslint \"src/**/*.{ts,tsx,js}\"",
    "prepublishOnly": "npm run prettier:fix && npm run lint && npm run test",
    "prettier:ci": "prettier --list-different \"src/**/*.[jt]s\" --parser typescript",
    "prettier:fix": "prettier --write \"./src/**/*.[jt]s\" --parser typescript",
    "semantic-release": "semantic-release",
    "test": "npm run build && jest --detectOpenHandles --runInBand --forceExit"
  },
  "bin": "dist/index.js",
  "pkg": {
    "targets": [
      "node14-linux-x64"
    ]
  },
  "dependencies": {
    "agentkeepalive": "^4.1.4",
    "axios": "^0.21.1",
    "chokidar": "^3.5.1",
    "lodash": "^4.17.21",
    "md5": "^2.3.0",
    "node-fetch": "^2.6.1",
    "source-map-support": "^0.5.19",
    "utf8": "^3.0.0"
  },
  "devDependencies": {
    "@babel/cli": "^7.14.3",
    "@babel/core": "^7.14.3",
    "@babel/plugin-proposal-class-properties": "^7.13.0",
    "@babel/plugin-proposal-decorators": "^7.14.2",
    "@babel/plugin-proposal-optional-chaining": "^7.14.2",
    "@babel/plugin-transform-typescript": "^7.14.4",
    "@babel/preset-env": "^7.14.4",
    "@babel/preset-typescript": "^7.13.0",
    "@types/aws-lambda": "^8.10.77",
    "@types/jest": "^26.0.23",
    "@typescript-eslint/parser": "^4.28.5",
    "axios-mock-adapter": "^1.19.0",
    "babel-eslint": "^10.1.0",
    "codecov": "^3.8.2",
    "eslint": "^5.16.0",
    "eslint-config-prettier": "^4.3.0",
    "eslint-plugin-jest": "^22.21.0",
    "eslint-plugin-prettier": "^3.4.0",
    "eslint-plugin-typescript": "^0.14.0",
    "jest": "^27.0.4",
    "mockdate": "^3.0.5",
    "prettier": "^2.3.1",
    "semantic-release": "^17.4.3",
    "typescript": "4.3.2",
    "typescript-eslint": "0.0.1-alpha.0",
    "uuid": "^8.3.2"
  }
}

and sometimes not always i get this error:

/usr/bin/pkg -> /usr/lib/node_modules/pkg/lib-es5/bin.js

Error: Cannot find module './functions/rsort' Require stack:

lumigo-tracer-extension: 6 - failed! Could not deploy: Packaging tracer-extension executable... /usr/bin/pkg -> /usr/lib/node_modules/pkg/lib-es5/bin.js

Error: Cannot find module './ranges/simplify' Require stack:

Expected Behavior

expect it to create the executable

To Reproduce

this is not always reproducing it is a flaky behavior.

running in circleci with the node12

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] commented 2 years ago

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.