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

[BUG] @types/node should be a devDependencies - causing build error with tsc and node 16 #693

Open
1 of 2 tasks
ilanc opened this issue Jul 8, 2021 · 0 comments
Open
1 of 2 tasks
Assignees
Labels

Comments

@ilanc
Copy link

ilanc commented Jul 8, 2021

Describe the bug
@types/node is specified in dependencies in ./packages/format/package.json. It should be a devDependencies. This is causing build errors with typescript.

Parsing or Formatting?

  • Formatting
  • Parsing

To Reproduce
Steps to reproduce the behavior:

  1. create a typescript module with "@types/node": "^16.0.0" in the modules package
  2. build with tsc

Expected behavior
no errors

Screenshots

tsc -p tsconfig.module.json

../../../node_modules/@fast-csv/format/build/src/CsvFormatterStream.d.ts:1:23 - error TS4090: Conflicting definitions for 'node' found at '/spike/v9/priv/node_modules/@fast-csv/format/node_modules/@types/node/index.d.ts' and '/spike/v9/priv/node_modules/@types/node/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.
  The file is in the program because:
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@types/request/index.d.ts' with packageId '@types/node/index.d.ts@16.0.0'
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@fast-csv/format/build/src/CsvFormatterStream.d.ts' with packageId '@types/node/index.d.ts@14.17.4'

1 /// <reference types="node" />
                        ~~~~

  ../../../node_modules/@types/request/index.d.ts:17:23
    17 /// <reference types="node" />
                             ~~~~
    File is included via type library reference here.

../../../node_modules/@fast-csv/format/build/src/index.d.ts:1:23 - error TS4090: Conflicting definitions for 'node' found at '/spike/v9/priv/node_modules/@fast-csv/format/node_modules/@types/node/index.d.ts' and '/spike/v9/priv/node_modules/@types/node/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.
  The file is in the program because:
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@types/request/index.d.ts' with packageId '@types/node/index.d.ts@16.0.0'
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@fast-csv/format/build/src/index.d.ts' with packageId '@types/node/index.d.ts@14.17.4'

1 /// <reference types="node" />
                        ~~~~

  ../../../node_modules/@types/request/index.d.ts:17:23
    17 /// <reference types="node" />
                             ~~~~
    File is included via type library reference here.


Found 2 errors.

../../../node_modules/@fast-csv/format/build/src/CsvFormatterStream.d.ts:1:23 - error TS4090: Conflicting definitions for 'node' found at '/spike/v9/priv/node_modules/@fast-csv/format/node_modules/@types/node/index.d.ts' and '/spike/v9/priv/node_modules/@types/node/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.
  The file is in the program because:
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@types/request/index.d.ts' with packageId '@types/node/index.d.ts@16.0.0'
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@fast-csv/format/build/src/CsvFormatterStream.d.ts' with packageId '@types/node/index.d.ts@14.17.4'

1 /// <reference types="node" />
                        ~~~~

  ../../../node_modules/@types/request/index.d.ts:17:23
    17 /// <reference types="node" />
                             ~~~~
    File is included via type library reference here.

../../../node_modules/@fast-csv/format/build/src/index.d.ts:1:23 - error TS4090: Conflicting definitions for 'node' found at '/spike/v9/priv/node_modules/@fast-csv/format/node_modules/@types/node/index.d.ts' and '/spike/v9/priv/node_modules/@types/node/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.
  The file is in the program because:
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@types/request/index.d.ts' with packageId '@types/node/index.d.ts@16.0.0'
    Type library referenced via 'node' from file '/spike/v9/priv/node_modules/@fast-csv/format/build/src/index.d.ts' with packageId '@types/node/index.d.ts@14.17.4'

1 /// <reference types="node" />
                        ~~~~

  ../../../node_modules/@types/request/index.d.ts:17:23
    17 /// <reference types="node" />
                             ~~~~
    File is included via type library reference here.


Found 2 errors.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build:module" exited with 2.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Desktop (please complete the following information):

  • OS: linux
  • OS Version ubuntu 18
  • Node Version 16.4.2
  • tsc 4.3.5

Aditional

my current workaround is to remove the @fast-csv @types/node and rebuild, but this has to be repeated every time I use yarn to install packages.

rm -rf /spike/v9/priv/node_modules/@fast-csv/format/node_modules/@types/node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants