feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.03k stars 750 forks source link

Could not find a declaration file for module 'socket.io-parser' #2487

Closed ssages closed 2 years ago

ssages commented 2 years ago

looks like @types/socket.io-parser is deprecated and missing the index.d.ts file https://www.npmjs.com/package/@types/socket.io-parser

Fixed it by removing the following line from package.json: "@types/socket.io-parser": "^3.0.0",

and added the following line in dependencies section: "socket.io-parser": "^4.1.1"

after that the application started and I could see the welcome page.

Steps to reproduce

feathers-chat feathers generate app ? Do you want to use JavaScript or TypeScript? TypeScript ? Project name feathers-chat ? Description ? What folder should the source files live in? src ? Which package manager are you using (has to be installed globally)? Yarn ? What type of API are you making? REST, Realtime via Socket.io ? Which testing framework do you prefer? Mocha + assert ? This app uses authentication Yes ? What authentication strategies do you want to use? (See API docs for all 180+ supported oAuth providers) Username + Password (Local) ? What is the name of the user (entity) service? users ? What kind of service is it? Mongoose ? What is the database connection string? mongodb://writer:password@localhost:27017/test?retryWrites=true create package.json create config/default.json create public/favicon.ico create public/index.html create .editorconfig create src/app.hooks.ts create src/channels.ts create src/declarations.d.ts create src/index.ts create src/logger.ts create src/middleware/index.ts create src/services/index.ts create .gitignore create README.md create src/app.ts create test/app.test.ts create tsconfig.json create .eslintrc.json create config/production.json create config/test.json create src/services/users/users.service.ts create src/authentication.ts create test/authentication.test.ts create src/mongoose.ts create src/services/users/users.class.ts create src/models/users.model.ts create src/services/users/users.hooks.ts create test/services/users.test.ts yarn add v1.22.11 info No lockfile found. [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... warning @feathersjs/authentication-oauth > grant > request-oauth > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. [3/5] 🚚 Fetching packages... [4/5] 🔗 Linking dependencies... [5/5] 🔨 Building fresh packages... success Saved lockfile. warning Your current version of Yarn is out of date. The latest version is "1.22.15", while you're on "1.22.11". info To upgrade, run the following command: $ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash success Saved 71 new dependencies. info Direct dependencies ├─ @feathersjs/authentication-local@4.5.11 └─ @feathersjs/authentication-oauth@4.5.11 info All dependencies ├─ @feathersjs/authentication-local@4.5.11 ├─ @feathersjs/authentication-oauth@4.5.11 ├─ @feathersjs/express@4.5.11 ├─ @feathersjs/transport-commons@4.5.11 ├─ @types/body-parser@1.19.1 ├─ @types/connect@3.4.35 ├─ @types/express-serve-static-core@4.17.25 ├─ @types/express@4.17.13 ├─ @types/jsonwebtoken@8.5.5 ├─ @types/mime@1.3.2 ├─ @types/range-parser@1.2.4 ├─ @types/serve-static@1.13.10 ├─ accepts@1.3.7 ├─ array-flatten@1.1.1 ├─ bcryptjs@2.4.3 ├─ body-parser@1.19.0 ├─ buffer-equal-constant-time@1.0.1 ├─ call-bind@1.0.2 ├─ content-disposition@0.5.3 ├─ cookie@0.4.1 ├─ destroy@1.0.4 ├─ ecdsa-sig-formatter@1.0.11 ├─ ee-first@1.1.1 ├─ events@3.3.0 ├─ express-session@1.17.2 ├─ express@4.17.1 ├─ finalhandler@1.1.2 ├─ forwarded@0.2.0 ├─ grant-profile@0.0.11 ├─ grant@4.7.0 ├─ has-symbols@1.0.2 ├─ has@1.0.3 ├─ inherits@2.0.3 ├─ ipaddr.js@1.9.1 ├─ jsonwebtoken@8.5.1 ├─ jwa@1.4.1 ├─ jws@3.2.2 ├─ lodash.includes@4.3.0 ├─ lodash.isboolean@3.0.3 ├─ lodash.isinteger@4.0.4 ├─ lodash.isnumber@3.0.3 ├─ lodash.isplainobject@4.0.6 ├─ lodash.isstring@4.0.1 ├─ lodash.once@4.1.1 ├─ long-timeout@0.1.1 ├─ media-typer@0.3.0 ├─ merge-descriptors@1.0.1 ├─ methods@1.1.2 ├─ mime-db@1.51.0 ├─ mime@1.6.0 ├─ ms@2.1.2 ├─ negotiator@0.6.2 ├─ oauth-sign@0.8.2 ├─ object-inspect@1.11.0 ├─ on-headers@1.0.2 ├─ path-to-regexp@0.1.7 ├─ proxy-addr@2.0.7 ├─ radix-router@3.0.1 ├─ random-bytes@1.0.0 ├─ raw-body@2.4.0 ├─ safe-buffer@5.2.1 ├─ safer-buffer@2.1.2 ├─ semver@5.7.1 ├─ serve-static@1.14.1 ├─ side-channel@1.0.4 ├─ type-is@1.6.18 ├─ uid-safe@2.1.5 ├─ unpipe@1.0.0 ├─ utils-merge@1.0.1 ├─ uuid@8.3.2 └─ vary@1.1.2 ✨ Done in 32.48s. yarn add v1.22.11 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... [3/5] 🚚 Fetching packages... warning Pattern ["@types/jsonwebtoken@^8.5.5"] is trying to unpack in the same destination "/Users/shahafsages/Library/Caches/Yarn/v6/npm-@types-jsonwebtoken-8.5.5-da5f2f4baee88f052ef3e4db4c1a0afb46cff22c-integrity/node_modules/@types/jsonwebtoken" as pattern ["@types/jsonwebtoken@^8.5.0"]. This could result in non-deterministic behavior, skipping. [4/5] 🔗 Linking dependencies... [5/5] 🔨 Building fresh packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ @types/jsonwebtoken@8.5.5 info All dependencies └─ @types/jsonwebtoken@8.5.5 ✨ Done in 3.67s. yarn add v1.22.11 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... [3/5] 🚚 Fetching packages... [4/5] 🔗 Linking dependencies... warning " > feathers-mongoose@8.4.2" has unmet peer dependency "mongoose@>=6.0.11". [5/5] 🔨 Building fresh packages... success Saved lockfile. success Saved 2 new dependencies. info Direct dependencies └─ feathers-mongoose@8.4.2 info All dependencies ├─ @feathersjs/adapter-commons@4.5.11 └─ feathers-mongoose@8.4.2 ✨ Done in 6.57s. yarn add v1.22.11 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... warning mongoose > @types/mongodb > @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed. [3/5] 🚚 Fetching packages... [4/5] 🔗 Linking dependencies... warning " > feathers-mongoose@8.4.2" has incorrect peer dependency "mongoose@>=6.0.11". [5/5] 🔨 Building fresh packages... success Saved lockfile. success Saved 30 new dependencies. info Direct dependencies ├─ mongodb-core@3.2.7 └─ mongoose@5.13.13 info All dependencies ├─ @types/bson@4.0.5 ├─ @types/mongodb@3.6.20 ├─ base64-js@1.5.1 ├─ bl@2.2.1 ├─ bluebird@3.5.1 ├─ bson@1.1.6 ├─ buffer@5.7.1 ├─ core-util-is@1.0.3 ├─ denque@1.5.1 ├─ ieee754@1.2.1 ├─ isarray@1.0.0 ├─ kareem@2.3.2 ├─ memory-pager@1.5.0 ├─ mongodb-core@3.2.7 ├─ mongodb@3.7.3 ├─ mongoose-legacy-pluralize@1.0.2 ├─ mongoose@5.13.13 ├─ mpath@0.8.4 ├─ mquery@3.2.5 ├─ optional-require@1.0.3 ├─ process-nextick-args@2.0.1 ├─ readable-stream@2.3.7 ├─ regexp-clone@1.0.0 ├─ require_optional@1.0.1 ├─ require-at@1.0.6 ├─ resolve-from@2.0.0 ├─ sift@13.5.2 ├─ sparse-bitfield@3.0.3 ├─ string_decoder@1.1.1 └─ util-deprecate@1.0.2 ✨ Done in 17.43s. yarn install v1.22.11 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... success Already up-to-date. ✨ Done in 0.42s. yarn add v1.22.11 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... warning @feathersjs/socketio > socket.io > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) warning @feathersjs/socketio > socket.io > engine.io > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) warning @feathersjs/socketio > socket.io > socket.io-parser > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) warning @feathersjs/socketio > @types/socket.io > @types/socket.io-parser@3.0.0: This is a stub types definition. socket.io-parser provides its own type definitions, so you do not need this installed. [3/5] 🚚 Fetching packages... [4/5] 🔗 Linking dependencies... warning " > feathers-mongoose@8.4.2" has incorrect peer dependency "mongoose@>=6.0.11". [5/5] 🔨 Building fresh packages... success Saved lockfile. success Saved 56 new dependencies. info Direct dependencies ├─ @feathersjs/configuration@4.5.11 ├─ @feathersjs/socketio@4.5.11 ├─ @feathersjs/transport-commons@4.5.11 ├─ compression@1.7.4 ├─ cors@2.8.5 ├─ helmet@4.6.0 ├─ serve-favicon@2.5.0 └─ winston@3.3.3 info All dependencies ├─ @dabh/diagnostics@2.0.2 ├─ @feathersjs/configuration@4.5.11 ├─ @feathersjs/socketio@4.5.11 ├─ @feathersjs/transport-commons@4.5.11 ├─ @socket.io/component-emitter@3.0.0 ├─ @types/engine.io@3.1.7 ├─ @types/socket.io-parser@3.0.0 ├─ @types/socket.io@2.1.13 ├─ after@0.8.2 ├─ arraybuffer.slice@0.0.7 ├─ async@3.2.2 ├─ backo2@1.0.2 ├─ base64-arraybuffer@0.1.4 ├─ base64id@2.0.0 ├─ blob@0.0.5 ├─ color-convert@1.9.3 ├─ color-name@1.1.3 ├─ color-string@1.6.0 ├─ color@3.2.1 ├─ colors@1.4.0 ├─ colorspace@1.1.4 ├─ component-bind@1.0.0 ├─ component-inherit@0.0.3 ├─ compressible@2.0.18 ├─ compression@1.7.4 ├─ config@3.3.6 ├─ cors@2.8.5 ├─ enabled@2.0.0 ├─ engine.io-client@3.5.2 ├─ engine.io@3.5.0 ├─ fecha@4.2.1 ├─ fn.name@1.1.0 ├─ has-cors@1.1.0 ├─ helmet@4.6.0 ├─ is-arrayish@0.3.2 ├─ is-stream@2.0.1 ├─ json5@2.2.0 ├─ kuler@2.0.0 ├─ logform@2.3.0 ├─ minimist@1.2.5 ├─ object-assign@4.1.1 ├─ one-time@1.0.0 ├─ safe-stable-stringify@1.1.1 ├─ serve-favicon@2.5.0 ├─ simple-swizzle@0.2.2 ├─ socket.io-adapter@1.1.2 ├─ socket.io-client@2.4.0 ├─ socket.io-parser@3.4.1 ├─ socket.io@2.4.1 ├─ stack-trace@0.0.10 ├─ text-hex@1.0.0 ├─ to-array@0.1.4 ├─ winston-transport@4.4.0 ├─ winston@3.3.3 ├─ xmlhttprequest-ssl@1.6.3 └─ yeast@0.1.2 ✨ Done in 19.10s. yarn add v1.22.11 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... [3/5] 🚚 Fetching packages... [4/5] 🔗 Linking dependencies... warning " > feathers-mongoose@8.4.2" has incorrect peer dependency "mongoose@>=6.0.11". [5/5] 🔨 Building fresh packages... success Saved lockfile. success Saved 165 new dependencies. info Direct dependencies ├─ @types/compression@1.7.2 ├─ @types/cors@2.8.12 ├─ @types/mocha@9.0.0 ├─ @types/serve-favicon@2.5.3 ├─ @typescript-eslint/eslint-plugin@5.3.1 ├─ @typescript-eslint/parser@5.3.1 ├─ axios@0.24.0 ├─ eslint@7.32.0 ├─ mocha@8.4.0 ├─ shx@0.3.3 ├─ ts-mocha@8.0.0 ├─ ts-node-dev@1.1.8 └─ typescript@4.4.4 info All dependencies ├─ @babel/code-frame@7.12.11 ├─ @babel/helper-validator-identifier@7.15.7 ├─ @babel/highlight@7.16.0 ├─ @eslint/eslintrc@0.4.3 ├─ @humanwhocodes/config-array@0.5.0 ├─ @humanwhocodes/object-schema@1.2.1 ├─ @nodelib/fs.scandir@2.1.5 ├─ @nodelib/fs.stat@2.0.5 ├─ @nodelib/fs.walk@1.2.8 ├─ @types/compression@1.7.2 ├─ @types/cors@2.8.12 ├─ @types/json-schema@7.0.9 ├─ @types/json5@0.0.29 ├─ @types/mocha@9.0.0 ├─ @types/serve-favicon@2.5.3 ├─ @types/strip-bom@3.0.0 ├─ @types/strip-json-comments@0.0.30 ├─ @typescript-eslint/eslint-plugin@5.3.1 ├─ @typescript-eslint/experimental-utils@5.3.1 ├─ @typescript-eslint/parser@5.3.1 ├─ @ungap/promise-all-settled@1.1.2 ├─ acorn-jsx@5.3.2 ├─ acorn@7.4.1 ├─ ajv@6.12.6 ├─ ansi-colors@4.1.1 ├─ ansi-regex@5.0.1 ├─ anymatch@3.1.2 ├─ arg@4.1.3 ├─ argparse@1.0.10 ├─ array-union@2.1.0 ├─ arrify@1.0.1 ├─ astral-regex@2.0.0 ├─ axios@0.24.0 ├─ balanced-match@1.0.2 ├─ binary-extensions@2.2.0 ├─ brace-expansion@1.1.11 ├─ browser-stdout@1.3.1 ├─ buffer-from@1.1.2 ├─ callsites@3.1.0 ├─ camelcase@6.2.0 ├─ chokidar@3.5.1 ├─ cliui@7.0.4 ├─ concat-map@0.0.1 ├─ create-require@1.1.1 ├─ cross-spawn@7.0.3 ├─ decamelize@4.0.0 ├─ deep-is@0.1.4 ├─ diff@5.0.0 ├─ dir-glob@3.0.1 ├─ doctrine@3.0.0 ├─ dynamic-dedupe@0.3.0 ├─ emoji-regex@8.0.0 ├─ enquirer@2.3.6 ├─ escalade@3.1.1 ├─ escape-string-regexp@4.0.0 ├─ eslint-utils@2.1.0 ├─ eslint-visitor-keys@1.3.0 ├─ eslint@7.32.0 ├─ espree@7.3.1 ├─ esprima@4.0.1 ├─ esquery@1.4.0 ├─ esrecurse@4.3.0 ├─ estraverse@5.3.0 ├─ fast-glob@3.2.7 ├─ fast-json-stable-stringify@2.1.0 ├─ fast-levenshtein@2.0.6 ├─ fastq@1.13.0 ├─ file-entry-cache@6.0.1 ├─ fill-range@7.0.1 ├─ find-up@5.0.0 ├─ flat-cache@3.0.4 ├─ flat@5.0.2 ├─ flatted@3.2.4 ├─ follow-redirects@1.14.5 ├─ fsevents@2.3.2 ├─ get-caller-file@2.0.5 ├─ glob-parent@5.1.2 ├─ globals@13.12.0 ├─ globby@11.0.4 ├─ growl@1.10.5 ├─ he@1.2.0 ├─ import-fresh@3.3.0 ├─ imurmurhash@0.1.4 ├─ interpret@1.4.0 ├─ is-core-module@2.8.0 ├─ is-extglob@2.1.1 ├─ is-number@7.0.0 ├─ is-plain-obj@2.1.0 ├─ isexe@2.0.0 ├─ js-tokens@4.0.0 ├─ json-schema-traverse@0.4.1 ├─ json-stable-stringify-without-jsonify@1.0.1 ├─ json5@1.0.1 ├─ locate-path@6.0.0 ├─ lodash.merge@4.6.2 ├─ lodash.truncate@4.4.2 ├─ log-symbols@4.0.0 ├─ lru-cache@6.0.0 ├─ micromatch@4.0.4 ├─ mkdirp@1.0.4 ├─ mocha@8.4.0 ├─ nanoid@3.1.20 ├─ natural-compare@1.4.0 ├─ optionator@0.9.1 ├─ p-limit@3.1.0 ├─ p-locate@5.0.0 ├─ parent-module@1.0.1 ├─ path-exists@4.0.0 ├─ path-key@3.1.1 ├─ path-parse@1.0.7 ├─ path-type@4.0.0 ├─ progress@2.0.3 ├─ punycode@2.1.1 ├─ queue-microtask@1.2.3 ├─ randombytes@2.1.0 ├─ readdirp@3.5.0 ├─ rechoir@0.6.2 ├─ regexpp@3.2.0 ├─ require-directory@2.1.1 ├─ require-from-string@2.0.2 ├─ resolve@1.20.0 ├─ reusify@1.0.4 ├─ rimraf@2.7.1 ├─ run-parallel@1.2.0 ├─ serialize-javascript@5.0.1 ├─ shebang-command@2.0.0 ├─ shebang-regex@3.0.0 ├─ shelljs@0.8.4 ├─ shx@0.3.3 ├─ slash@3.0.0 ├─ slice-ansi@4.0.0 ├─ source-map-support@0.5.20 ├─ source-map@0.6.1 ├─ sprintf-js@1.0.3 ├─ string-width@4.2.3 ├─ strip-bom@3.0.0 ├─ strip-json-comments@3.1.1 ├─ supports-color@8.1.1 ├─ table@6.7.3 ├─ text-table@0.2.0 ├─ to-regex-range@5.0.1 ├─ tree-kill@1.2.2 ├─ ts-mocha@8.0.0 ├─ ts-node-dev@1.1.8 ├─ ts-node@7.0.1 ├─ tsconfig-paths@3.11.0 ├─ tsconfig@7.0.0 ├─ tslib@1.14.1 ├─ type-check@0.4.0 ├─ type-fest@0.20.2 ├─ typescript@4.4.4 ├─ v8-compile-cache@2.3.0 ├─ which@2.0.2 ├─ wide-align@1.1.3 ├─ word-wrap@1.2.3 ├─ workerpool@6.1.0 ├─ wrap-ansi@7.0.0 ├─ xtend@4.0.2 ├─ y18n@5.0.8 ├─ yallist@4.0.0 ├─ yargs-parser@20.2.4 ├─ yargs-unparser@2.0.0 ├─ yargs@16.2.0 ├─ yn@3.1.1 └─ yocto-queue@0.1.0 ✨ Done in 82.94s.

Make sure that your mongodb database is running, the username/role is correct, and "mongodb://writer:password@localhost:27017/test?retryWrites=true" is reachable and the database has been created. Your configuration can be found in the projects config/ folder. yarn run v1.22.11 $ eslint src/. test/. --config .eslintrc.json --ext .ts --fix --fix ✨ Done in 9.20s. ➜ feathers-chat npm start

feathers-chat@0.0.0 start yarn run compile && node lib/

yarn run v1.22.11 $ shx rm -rf lib/ && tsc node_modules/@types/socket.io/index.d.ts:20:68 - error TS7016: Could not find a declaration file for module 'socket.io-parser'. '/Users/shahafsages/Learn/webapp-lib/feathers-chat/node_modules/socket.io-parser/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/socket.io-parser if it exists or add a new declaration (.d.ts) file containing declare module 'socket.io-parser';

20 import { Encoder as ParserEncoder, Decoder as ParserDecoder } from 'socket.io-parser';



Found 1 error.

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

I did not encounter this error when implementing https://github.com/feathersjs/generator-feathers/pull/633 so it is likely now fixed in the latest @feathersjs/cli.

RickCarlino commented 2 years ago

Is anyone seeing this error again? I started a project today and got the error above. My attempt to reproduce the issue in isolation is below. The first time I hit the error, I only got the Socket.io error. When I tried to re-produce in isolation, I got the original error, plus a few more.

mkdir example
cd example/
$ feathers --version
4.7.0
$ tsc --version
Version 4.1.3
$ feathers generate app
? Do you want to use JavaScript or TypeScript? TypeScript
? Project name example
? Description abc
? What folder should the source files live in? src
? Which package manager are you using (has to be installed globally)? npm
? What type of API are you making? REST, Realtime via Socket.io
? Which testing framework do you prefer? Jest
? This app uses authentication Yes
? What authentication strategies do you want to use? (See API docs for all 180+ supported oAuth providers) Username + Password (Local)
? What is the name of the user (entity) service? users
? What kind of service is it? MongoDB
? What is the database connection string? mongodb://localhost:27017/example

npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 109 packages, and audited 110 packages in 2s

npm ERR! code ETARGET
npm ERR! notarget No matching version found for parseqs@0.0.6.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rick/.npm/_logs/2022-04-13T13_05_55_090Z-debug.log

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.6.0

YOUR TYPESCRIPT VERSION: 4.6.2

Please only submit bug reports when using the officially supported version.

=============

/home/rick/code/example/test/app.test.ts
  1:8  warning  'assert' is defined but never used  @typescript-eslint/no-unused-vars

✖ 1 problem (0 errors, 1 warning)
$ npm install

up to date, audited 570 packages in 2s
found 0 vulnerabilities
$ npm start

> example@0.0.0 start
> npm run compile && node lib/

> example@0.0.0 compile
> shx rm -rf lib/ && tsc

src/app.ts:4:20 - error TS2307: Cannot find module 'helmet' or its corresponding type declarations.

4 import helmet from 'helmet';
                     ~~~~~~~~

src/app.ts:8:27 - error TS2307: Cannot find module '@feathersjs/configuration' or its corresponding type declarations.

8 import configuration from '@feathersjs/configuration';
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/app.ts:10:22 - error TS2307: Cannot find module '@feathersjs/socketio' or its corresponding type declarations.

10 import socketio from '@feathersjs/socketio';
                        ~~~~~~~~~~~~~~~~~~~~~~

src/logger.ts:1:50 - error TS2307: Cannot find module 'winston' or its corresponding type declarations.

1 import { createLogger, format, transports } from 'winston';
                                                   ~~~~~~~~~

Found 4 errors in 2 files.

Errors  Files
     3  src/app.ts:4
     1  src/logger.ts:1