收藏
回答

npm ERR! code ELIFECYCLE


编译不通过 什么原因呢

回答关注问题邀请回答
收藏

2 个回答

  • 🐯
    🐯
    2019-01-11

    对 输入npm run compile


    error TS2318: Cannot find global type 'CallableFunction'.


    error TS2318: Cannot find global type 'NewableFunction'.



    Found 2 errors.


    npm ERR! code ELIFECYCLE

    npm ERR! errno 2

    npm ERR! welfareHub@1.0.0 compile: `tsc`

    npm ERR! Exit status 2

    npm ERR!

    npm ERR! Failed at the welfareHub@1.0.0 compile script.

    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


    npm ERR! A complete log of this run can be found in:

    npm ERR!     /Users/zhangxiaolong/.npm/_logs/2019-01-11T07_20_07_330Z-debug.log


    2019-01-11
    有用
    回复 2
    • HS
      HS
      2019-01-11

      建议更新一下工具试试呢

      2019-01-11
      回复
    • 🐯
      🐯
      2019-01-12

      我知道了

      执行tsc的时候默认使用 /usr/local/bin/tsc

      修改package.json

      "scripts": {

        "tsc""./node_modules/typescript/bin/tsc",

        "compile""./node_modules/typescript/bin/tsc"

      }


      2019-01-12
      回复
  • HS
    HS
    2019-01-11

    是使用了 TypeScript 的项目?在终端命令行打开这个目录,运行 npm run compile 或者 tsc 试下呢

    2019-01-11
    有用
    回复 1
登录 后发表内容