Skip to content

Cannot find module 'ws' or its corresponding type declarations. #6093

Closed
@ALongLi

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
tscws
.
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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions