收藏
回答

ts在预览或者真机调试报错

框架类型 问题类型 操作系统 工具版本
小程序 Bug macOS 1.02.1906141

- 当前 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 npm@5.6.0

3 info using node@v10.0.0

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

5 info lifecycle demo@1.0.1~pretsc: demo@1.0.1

6 info lifecycle demo@1.0.1~tsc: demo@1.0.1

7 verbose lifecycle demo@1.0.1~tsc: unsafe-perm in lifecycle true

8 verbose lifecycle demo@1.0.1~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 demo@1.0.1~tsc: CWD: /Users/zhans.dong/data/workspace4/iCard

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

11 silly lifecycle demo@1.0.1~tsc: Returned: code: 2  signal: null

12 info lifecycle demo@1.0.1~tsc: Failed to exec tsc script

13 verbose stack Error: demo@1.0.1 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 demo@1.0.1

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 demo@1.0.1 tsc: `node ./node_modules/typescript/lib/tsc.js`

22 error Exit status 2

23 error Failed at the demo@1.0.1 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 个回答

  • 社区技术运营专员-小柿子
    社区技术运营专员-小柿子
    2019-06-17

    https://developers.weixin.qq.com/miniprogram/dev/devtools/nightly.html试下这个版本?我测试下没复现

    2019-06-17
    有用
    回复 4
    • 董詩瞻
      董詩瞻
      2019-06-17

      我在检查一下   貌似我代码有问题

      2019-06-17
      回复
    • 董詩瞻
      董詩瞻
      2019-06-17

      估计ts编辑不通过引起的,我有一些文件引用了老的js项目的共库文件


      这个报错信息能改下使其一直留存么

      现在是刷一下 就没了

      2019-06-17
      回复
    • lich
      lich
      2019-07-05回复董詩瞻

      调试器 -> Console Settings (齿轮) -> Preserve log (勾选上) 👌

      2019-07-05
      1
      回复
    • Boogie_孝勇
      Boogie_孝勇
      03-23回复董詩瞻
      bro 这个问题怎么解决的 我用ts 起的个模版  然后 用npm 装了vant-weapp 然后保存编译就出现这种报错
      03-23
      回复
  • 高思纯
    高思纯
    2019-12-16

    怎么解决

    2019-12-16
    有用
    回复
  • 郭慧琴
    郭慧琴
    2019-09-09

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

    2019-09-09
    有用
    回复
登录 后发表内容