Skip to content

failed to import TS file from node_modules on Linux & Mac #990

Description

@TechQuery

Expected Behavior

I want to import everything (including TS source codes in node_modules/) :

register({
    ignore: [],
    compilerOptions: { module: 'CommonJS' }
});

https://github.com/EasyWebApp/MarkCell/blob/7b43ea0/source/File.ts#L26-L29

Actual Behavior

OS result
Windows everything is OK
Linux TypeError: Unable to require file: node_modules/xxx/source/yyy.tsx
Mac TypeError: Unable to require file: node_modules/xxx/source/yyy.tsx

error on Linux

https://travis-ci.com/github/EasyWebApp/mark-wiki/builds/155135722

error on Mac

image

Steps to reproduce the problem

git clone https://github.com/EasyWebApp/mark-wiki.git
cd mark-wiki/
npm install
npm run build

Minimal reproduction

TypeStrong/ts-node-repros#1

Specifications

  • ts-node version: 8.8.1
  • TypeScript version: 3.8.3
  • tsconfig.json, if you're using one:
{
    "compilerOptions": {
        "module": "ESNext",
        "moduleResolution": "Node",
        "resolveJsonModule": true,
        "experimentalDecorators": true,
        "jsx": "react",
        "jsxFactory": "createCell",
        "target": "ES5",
        "lib": ["ES2019", "DOM"]
    },
    "include": ["source/**/*"]
}
  • node version: 12.16.1
  • If Windows, are you using WSL or WSL2?: No

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions