的时候,报错:
ERROR in node_modules/@types/jasmine/index.d.ts(138,47): error TS1005: ';' expected.
node_modules/@types/jasmine/index.d.ts(138,90): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(138,104): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(138,112): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,113): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,121): error TS1005: ')' expected.
node_modules/@types/jasmine/index.d.ts(138,147): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(138,162): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(138,163): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,164): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,165): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,179): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,183): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,208): error TS1005: '{' expected.
node_modules/@types/jasmine/index.d.ts(138,217): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,222): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,227): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,228): error TS1109: Expression expected.
node_modules/@types/jasmine/index.d.ts(138,230): error TS1005: ')' expected.
"@types/jasmine": "2.5.38",
"typescript": "~2.5.3"
版本不匹配导致
解决方法:
更换 "typescript": "~2.9.2"
总之,将两个包的版本调到匹配就好。
Angular:ERROR in node_modules/@types/jasmine/index.d.ts(138,47): error TS1005: ‘;‘ expected.
场景:在run ng test的时候,报错:ERROR in node_modules/@types/jasmine/index.d.ts(138,47): error TS1005: ';' expected.node_modules/@types/jasmine/index.d.ts(138,90): error TS1005: '(' expected.node...
node_modules
/
@types
/node/
index
.d.
ts
:20:1: Invalid ‘reference’ directive syntax.
Starting compilation using the
angular
compiler.
(node:71443) DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsMod
node_modules
/
@types
/pdfjs-dist/
index
.d.
ts
(7,1)中的错误:错误
TS
1084:无效的“引用”指令
解决:升级typescript版本
使用命令“ npm i typescript@3.5.1”
注:typescript版本升级后可能会带来app打包签名后不能正常启动,慎!
经过排查,主要原因是该插件与tyscript的版本不兼容,不支持上述文件下的语句。
htmlparser2被升级到了6.0.1,这时所要求的
ts
版本是4点多,但是本地是3点多,导致不兼容。
因此将该插件的版本进行降级,降级为3.9.1版本。
internal/modules/cjs/loader.js:985
Cannot find module ‘./router’
开始以为是缺少模块,后来发现是使用的express模块版本较早,因为是好久以前的
node_modules
文件夹复制过来的,就删除之后用npm install express重新安装express模块,成功解决问题。
angular
项目中start的时候报这个错,周围的人有的人报这个错,有的人没有报这个错。把我的解决办法写下来,供参考。
1.更改Types版本
我们打开package.json。找到
@Types
/node:
"
@types
/node": "^12.11.7",
我们可以打开
https://www.npmjs.com/package/
@types
/node
找到一个低版本的
@Types
/node。我选择的是11.15.49。然后重新yarn。再运行项目就行了。
2.直接替换文件
ERROR
in
node_modules
/
@types
/node/
ts
3.5/globals.global.d.
ts
:1:13 -
error
TS
2403: Subsequent variable declarations must have the same type. Variable 'global' must be of type 'Global', but here has type 'Global & typeof globalThis'.
1 declare var
angular
项目 运行提示
node_modules
/rxjs/internal/types.d.
ts
(81,74):
error
TS
1005: ‘;’
expected
. 解决 方案
打开package.json 文件
将 “rxjs”:"^6.0.0" 为 “rxjs”:“6.0.0”
Ask Question
First of all, I've already seen the other pos
ts
about
error
TS
1005. Same
error
code, but totally different ;)
I was excited to try ...
Angular: Module build failed (from ./node_modules/_sass-loader@7.1.0@sass-loader/lib/loader.js):
我是隔壁老王呀:
RxJS中文手册
KongX_B:
RxJS中文手册
Angular :FormControl 和 FormGroup
qq_40905431: