简体   繁体   中英

Cannot find module 'socket.io' in Visual Studio node.js project on typesctipt

I have some node.js project on Visual Studio, It works fine, But when i try to import 'socket.io' it shows error - Cannot find module 'socket.io'. I cannot even build project. it is installed in node_modules folder, but anyway not found. Any Ideas?

code:

import express = require('express');
import http = require('http');
import path = require('path');
import io = require('socket.io');

Fixed. I had forgotten to add typings for socket.io

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM