简体   繁体   English

打字稿错误TS1005:';' 预期。 TS v1.8.10

[英]Typescript error TS1005: ';' expected. TS v1.8.10

I am receiving the following error when trying to compile a typescript file. 尝试编译打字稿文件时收到以下错误。 This is more first time playing with typescript so honestly I have no idea on what I am doing wrong... 这是第一次使用打字稿,所以说实话,我不知道我在做什么错...

Running "ts:default" (ts) task
Compiling...
### Fast Compile >>src/FileProcessor.ts
Using tsc v1.8.10
src/FileProcessor.ts(1,21): error TS1005: ';' expected.

I am compiling it with "grunt-ts" using the following grunt task... 我正在使用以下grunt任务使用“ grunt-ts”进行编译...

ts: {
  default: {
    src: ['src/**/*.ts'],
    outDir: 'lib/',
    options: {
      module: 'commonjs'
    }
  }
},

Below is my typescript file 以下是我的打字稿文件

import path = module('path');

console.log(path.join('test', 'test2'));

Switch 开关

import path = module('path');

to

import path = require('path');

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

相关问题 打字稿错误TS1005:':'预期。使用Object.assign() - Typescript error TS1005: ':' expected. with Object.assign() 打字稿错误 TS1005: ';' 预期 - Typescript error TS1005: ';' expected 数组中的散布操作出错。 TS1005:“,”应为。 打字稿 - Error with spread operation in array. TS1005: ',' expected. TypeScript 将Angular2-rc1升级到Angular2-rc2,面向TypeScript','。 (TS1005) - Upgrade Angular2-rc1 to Angular2-rc2, facing TypeScript ',' expected. (TS1005) 错误 TS1005: ',' expected, failing to compile angular 6 project - error TS1005: ',' expected, failing to compile angular 6 project TS1005 错误,“,”预期为 simple.forEach 循环 - TS1005 error, ','expected with simple .forEach loop 错误:src/app/components/button/button.component.ts:11:27 - 错误 TS1005: '(' 预期 - Error: src/app/components/button/button.component.ts:11:27 - error TS1005: '(' expected 为什么我得到 ':' expected.ts(1005) 作为 Typescript 错误? - Why do I get ':' expected.ts(1005) as a Typescript error? 当我在 discord 中创建机器人时,为什么我在 Visual Studio Code 中得到“','预期的 ts1005” - Why i get “ ',' expected ts1005” in Visual Studio Code when i am creating a bot in discord 获取:错误 TS1128:预期的声明或语句。 在 ReactJS 和 TypeScript 应用程序中 - Getting: error TS1128: Declaration or statement expected. In ReactJS & TypeScript app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM