Cannot find module 'ws' or its corresponding type declarations. #6093
Closed
Description
Describe the bug
when I run build ,tsc && tsc && vite build 。 tsc faied node_modules/vite/dist/node/index.d.ts:50:54 - error TS2307: Cannot find module 'ws' or its corresponding type declarations
.
only vite build it is success
Reproduction
none
System Info
System:
OS: Windows 10 10.0.18363
CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
Memory: 15.56 GB / 31.94 GB
Binaries:
Node: 12.14.1 - ~\software\nodejs\node.EXE
npm: 6.13.4 - ~\software\nodejs\npm.CMD
npmPackages:
@vitejs/plugin-react-refresh: ^1.3.1 => 1.3.6
vite: ^2.0.3 => 2.7.1
Used Package Manager
npm
Logs
> tsc && vite build
node_modules/vite/dist/node/index.d.ts:50:54 - error TS2307: Cannot find module 'ws' or its corresponding type declarations.
50 import { WebSocketServer as WebSocketServer_2 } from 'ws';
~~~~
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.