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

Support building with newer @types/node module #695

Open
pravi opened this issue Jun 11, 2021 · 1 comment
Open

Support building with newer @types/node module #695

pravi opened this issue Jun 11, 2021 · 1 comment

Comments

@pravi
Copy link

pravi commented Jun 11, 2021

We'd like to build memfs module in debian with newer version of @types/node module, but build fails with this error. Please update build dependency on @types/node to at least 12.20.4.

$ yarnpkg upgrade @types/node@12.20.4
yarn upgrade v1.22.10
warning ../../../../package.json: No license field
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "jest > @jest/core > jest-config > babel-jest@27.0.2" has incorrect peer dependency "@babel/core@^7.8.0".
warning " > tslint-config-common@1.6.0" has incorrect peer dependency "typescript@^3.0.1".
[5/5] Rebuilding all packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ @types/node@12.20.4
info All dependencies
└─ @types/node@12.20.4
Done in 8.13s.
(debian-sid)pravi@mahishi:~/forge/js-team/upstream/memfs$ yarnpkg build
yarn run v1.22.10
warning ../../../../package.json: No license field
$ tsc -p . && cpy src/*.js lib
src/volume.ts:433:15 - error TS2769: No overload matches this call.
  Overload 1 of 5, '(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number | undefined, length?: number | undefined): Buffer', gave the following error.
    Argument of type 'string' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
  Overload 2 of 5, '(obj: { valueOf(): string | object; } | { [Symbol.toPrimitive](hint: "string"): string; }, byteOffset?: number | undefined, length?: number | undefined): Buffer', gave the following error.
    Argument of type 'string' is not assignable to parameter of type 'number | undefined'.
  Overload 3 of 5, '(str: string, encoding?: BufferEncoding | undefined): Buffer', gave the following error.
    Argument of type 'string' is not assignable to parameter of type 'BufferEncoding | undefined'.

433   else return bufferFrom(String(data), encoding);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Found 1 error.

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

@G-Rath
Copy link
Collaborator

G-Rath commented Nov 3, 2022

I'm not sure if we actually want to be doing this because we target Node 4+, and what our dependency is for building shouldn't matter to downstream consumers since its not a "runtime" dependency (granted with @types/node that can get a bit fuzzy depending on what types we use, but we shouldn't be using a lot of actual types from there).

Is there any reason why you're wanting to use @types/node v12 to build this library, other than "it's a later version"?

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

Successfully merging a pull request may close this issue.

2 participants