简体   繁体   English

在TypesCtipt的Visual Studio node.js项目中找不到模块“ socket.io”

[英]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'. 我在Visual Studio上有一些node.js项目,它工作正常,但是当我尝试导入'socket.io'时显示错误-找不到模块'socket.io'。 I cannot even build project. 我什至无法建立项目。 it is installed in node_modules folder, but anyway not found. 它安装在node_modules文件夹中,但是仍然找不到。 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 我忘记为socket.io添加类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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