Skip to content

Using ts-node main branch as a dependency fails on Yarn berry #2002

Description

Expected Behavior

Installing the patched version (for tsconfig.json with extended config array support) on main with Yarn Berry (v.3.5.0) should work:

yarn install

Actual Behavior

The above command causes the following errors:

Causes an error during prepack phase:

➤ YN0000: ┌ Resolution step
➤ YN0013: │ ts-node@https://github.com/TypeStrong/ts-node.git#commit=71dcfd7b813a4178d89562bb4c28d7d6579fae4f can't be found in the cache and will be fetched from GitHub
➤ YN0013: │ ts-node@https://github.com/TypeStrong/ts-node.git#commit=71dcfd7b813a4178d89562bb4c28d7d6579fae4f can't be found in the cache and will be fetched from the remote repository
➤ YN0058: │ ts-node@https://github.com/TypeStrong/ts-node.git#commit=71dcfd7b813a4178d89562bb4c28d7d6579fae4f: Packing the package failed (exit code 1, logs can be found here: C:\Users\Reaper\AppData\Local\Temp\xfs-3b2a30dd\pack.log)
➤ YN0000: └ Completed in 19s 92ms
➤ YN0000: Failed with errors in 19s 103ms

The mentioned log contains:

Packing ts-node@https://github.com/TypeStrong/ts-node.git#commit=71dcfd7b813a4178d89562bb4c28d7d6579fae4f from sources
Using Yarn for bootstrap. Reason: found {"packageManager":"yarn@3.4.1"} in manifest

�[31m�[1mInternal Error�[22m�[39m: @cspotcode/expect-stream@https://github.com/cspotcode/node-expect-stream.git#commit=4e425ff1eef240003af8716291e80fbaf3e3ae8f: Packing the package failed (exit code 1, logs can be found here: C:\Users\Reaper\AppData\Local\Temp\xfs-38ed450c\pack.log)
    at C:\Users\Reaper\AppData\Local\Temp\xfs-48ac0a0d\.yarn\releases\yarn-3.4.1.cjs:422:1665
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async $t.mktempPromise (C:\Users\Reaper\AppData\Local\Temp\xfs-48ac0a0d\.yarn\releases\yarn-3.4.1.cjs:314:69409)
    at async C:\Users\Reaper\AppData\Local\Temp\xfs-48ac0a0d\.yarn\releases\yarn-3.4.1.cjs:419:66
    at async $t.mktempPromise (C:\Users\Reaper\AppData\Local\Temp\xfs-48ac0a0d\.yarn\releases\yarn-3.4.1.cjs:314:69409)
    at async C:\Users\Reaper\AppData\Local\Temp\xfs-48ac0a0d\.yarn\releases\yarn-3.4.1.cjs:414:3118

Steps to reproduce the problem

  • Set Yarn to version berry via yarn set version berry
  • Set Yarn to use node-modules: yarn config set nodeLinker node-modules
  • Use the main branch of ts-node as dependencies.

Specifications

  • ts-node version: none.. patched branch on main!
  • node version: 19.5.0
  • TypeScript version: 5.4.0
  • tsconfig.json, if you're using one:
{
  "ts-node": {
    "esm": true,
    "compilerOptions": {
      "allowJs": false,
    },
    "files":         true,
    "transpileOnly": true
  },
  "compilerOptions": {
    "baseUrl": ".",
    "rootDir": "src",
    "target":  "ESNext",
    "module":  "NodeNext",

    "strict":                   true,
    "removeComments":           true,
    "preserveConstEnums":       true,
    "sourceMap":                true,
    "outDir":                   "build",
    "allowJs":                  true,
    "skipLibCheck":             true,
    "noUncheckedIndexedAccess": true,

    "esModuleInterop":                  true,
    "moduleResolution":                 "NodeNext",
    "forceConsistentCasingInFileNames": false,
    "resolveJsonModule":                true
  },
  "include": [
    "src/**/*"
  ],
  "exclude": [
    "node_modules"
  ],
  "watchOptions": {
    "watchFile":      "useFsEvents",
    "watchDirectory": "useFsEvents",
    "fallbackPolling": "dynamicPriority"
  }
}
  • package.json:
{
  "name": "@timsa/js-ts-test-bench",
  "author": "41ph4-Ph4un",
  "type": "module",
  "scripts": {
    "clean": "tsc -b --clean",
    "build": "yarn run clean && tsc -b",
    "lint": "eslint \"./**/*.{js,cjs,mjs,ts}\"",
    "lint:fix": "eslint --fix \"./**/*.{js,cjs,mjs,ts}\"",
    "start": "tsc -b -w",
    "start:ts-node": "ts-node",
    "execute": "node ./build/index.js"
  },
  "devDependencies": {
    "@types/node": "^18.16.2",
    "@typescript-eslint/eslint-plugin": "^5.59.1",
    "@typescript-eslint/parser": "^5.59.1",
    "eslint": "^8.39.0",
    "ts-node": "TypeStrong/ts-node#main",
    "typescript": "^5.0.4"
  },
  "packageManager": "yarn@3.5.0"
}
  • Operating system and version: Windows 10

Activity

  1. cspotcode commented on May 8, 2023

    @cspotcode
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions