jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.43k stars 775 forks source link

Type errors when building in docker #1006

Closed Graunephar closed 1 year ago

Graunephar commented 1 year ago

When I add fx-extra to my project. And build my project in a container based on the node:16-slim docker image, running in Google Cloud build I get the following build error, when compiling with tsc.

> tsc

node_modules/@types/fs-extra/index.d.ts(930,48): error TS2694: Namespace '"fs"' has no exported member 'EncodingOption'.
node_modules/@types/fs-extra/index.d.ts(934,28): error TS2339: Property 'rm' does not exist on type 'typeof import("fs")'.
node_modules/@types/fs-extra/index.d.ts(934,57): error TS2339: Property 'rm' does not exist on type 'typeof import("fs")'.
The command '/bin/sh -c npm run build' returned a non-zero code: 2
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 2
RyanZim commented 1 year ago

This is a bug with https://www.npmjs.com/package/@types/fs-extra; not fs-extra itself.