microsoft / TypeScript-Node-Starter

A reference example for TypeScript and Node with a detailed README describing how to use the two together.
MIT License
11.29k stars 2.76k forks source link

build failed #349

Closed fingerpich closed 2 years ago

fingerpich commented 2 years ago

node_modules/mongoose/node_modules/@types/mongodb/index.d.ts:58:111 - error TS7016: Could not find a declaration file for module 'bson'. '/Users/fingerpich/Documents/projects/deyorg/backend/node_modules/bson/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/bson if it exists or add a new declaration (.d.ts) file containing declare module 'bson';

fingerpich commented 2 years ago

Fixed the problem with npm i bson

peterblazejewicz commented 2 years ago

thx! just a note, there was a lot of changes in DT ecosystem for mongo/mongoose, including packages going native TS, not using definition files anymore, so there could be a problem sometimes when resolving dependencies for some deps, like here in this project.

mozgbrasil commented 2 years ago

Good morning my friends

I installed the dependency here but the error persists, can you help me

clear && ls && rm -fr dist node_modules package-lock.json yarn.lock && ls && yarn && yarn run debug

Thanks in advance to everyone who can contribute.

Captura de tela de 2022-02-08 16-41-34 Captura de tela de 2022-02-08 16-41-41

peterblazejewicz commented 2 years ago

@mozgbrasil I've merged fixes tested on Debian with Yarn 1.22.*. This project is not very actively developed so some of the dependencies were resolved differently and missing actual types, when Yarn was used as the package manager. I've added fixed versions matching this project setup and made this project compatible with Node v14 or newer. Thanks!