if the javascript did not have type files, how avoid the type missing issue

30 views Asked by At

Today when I import the forked y-websocket project https://github.com/RedDwarfTech/y-websocket like this in typescript project:

import { WebsocketProvider } from "y-websocket";

shows error like this:

Cannot find module 'y-websocket' or its corresponding type declarations.ts(2307)

I have tried to install the type file like this:

> pnpm install --save-dev @types/y-websocket
 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/@types%2Fy-websocket: Not Found - 404

This error happened while installing a direct dependency of /Users/xiaoqiangjiang/source/reddwarf/frontend/texhub-web

@types/y-websocket is not in the npm registry, or you have no permission to fetch it.

An authorization header was used: Bearer npm_[hidden]
Progress: resolved 54, reused 54, downloaded 0, added 0

search from google and did not found the type files of y-websocket(the official did not contains type files too), is it possible to ignore this error? how to handle the project did not contains any type files?

0

There are 0 answers