无法在nodejs中input打字稿文件
我想在一个Typescript文件中导入下划线模块,但是它的创build麻烦,因为当我在节点中运行typescript模块,它会引发一个错误:
Code: import _ = require('underscore'); Error: import _ = require('underscore'); ^^^^^^ SyntaxError: Unexpected reserved word at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17)
你必须编译TypeScript文件。 然后,在节点中运行生成的.js文件。
- TypeScript es6-promise,我如何匹配Promise构造函数
- 打字稿错误:TS2304:找不到名称'$'
- 所有使用Angular 2(+)和Node / Express服务器的TypeScript项目设置
- 如何在使用NodeJS目标的TypeScript中正确使用模块和接口?
- 用TypeScript导入节点模块
- 全栈应用程序应该有多less个package.json文件?
- 如何发送邮件请求在Ionic 2节点服务器运行在本地主机?
- 使用Typescript设置一个带有Angular 2前端的Node.js js服务器
- TypeScript – 使用<reference path =“…”>标记