Ole*_*Ole 16 node.js typescript typescript2.2 ts-node
我正在尝试使用ts-node运行以下代码.
import { writeFileSync, readFileSync } from 'fs';
Run Code Online (Sandbox Code Playgroud)
但是我得到:
src/main/ts/create.ts (1,45): Cannot find module 'fs'. (2307)
Run Code Online (Sandbox Code Playgroud)
我需要做什么来允许typescript导入fs模块?
Rem*_*sen 28
你需要运行:
$ npm install @types/node --save-dev
Run Code Online (Sandbox Code Playgroud)
如果您需要其他信息,可以参考Basarat的TypeScript Deep Dive中的NodeJS QuickStart.
| 归档时间: |
|
| 查看次数: |
12077 次 |
| 最近记录: |