ts在预览或者真机调试报错
发布于 6 年前 作者 mguo 6206 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

工具栏和日志中报错

0 info it worked if it ends with ok

1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'tsc' ]

2 info using [email protected]

3 info using [email protected]

4 verbose run-script [ 'pretsc', 'tsc', 'posttsc' ]

5 info lifecycle [email protected]~pretsc: [email protected]

6 info lifecycle [email protected]~tsc: [email protected]

7 verbose lifecycle [email protected]~tsc: unsafe-perm in lifecycle true

8 verbose lifecycle [email protected]~tsc: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/zhans.dong/data/workspace4/iCard/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

9 verbose lifecycle [email protected]~tsc: CWD: /Users/zhans.dong/data/workspace4/iCard

10 silly lifecycle [email protected]~tsc: Args: [ '-c', 'node ./node_modules/typescript/lib/tsc.js' ]

11 silly lifecycle [email protected]~tsc: Returned: code: 2  signal: null

12 info lifecycle [email protected]~tsc: Failed to exec tsc script

13 verbose stack Error: [email protected] tsc: `node ./node_modules/typescript/lib/tsc.js`

13 verbose stack Exit status 2

13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)

13 verbose stack     at EventEmitter.emit (events.js:182:13)

13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)

13 verbose stack     at ChildProcess.emit (events.js:182:13)

13 verbose stack     at maybeClose (internal/child_process.js:947:16)

13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)

14 verbose pkgid [email protected]

15 verbose cwd /Users/zhans.dong/data/workspace4/iCard

16 verbose Darwin 18.6.0

17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "tsc"

18 verbose node v10.0.0

19 verbose npm  v5.6.0

20 error code ELIFECYCLE

21 error errno 2

22 error [email protected] tsc: `node ./node_modules/typescript/lib/tsc.js`

22 error Exit status 2

23 error Failed at the [email protected] tsc script.

23 error This is probably not a problem with npm. There is likely additional logging output above.

24 verbose exit [ 2, true ]

  • 预期表现

没有报错,出现正常二维码

  • 复现路径
  • 提供一个最简复现 Demo

新建自动生成的demo就有该错误。

3 回复

怎么解决

你好,请问最后是怎么解决的啊?

回到顶部