Git Product home page Git Product logo

Comments (5)

hjkcai avatar hjkcai commented on June 5, 2024

这个项目有点老了,很多 npm 包都已经更新了,所以就跪了

可以试一下临时解决方法:

  1. 删掉 node_modules
  2. package.json 里面的 ^ 全部替换成 ~
  3. 再试一下

from cardiovascular-tracker.

jsjzyzc avatar jsjzyzc commented on June 5, 2024

[email protected] start /Users/grayson/Desktop/cardiovascular-tracker-master/server
tsc && NODE_ENV=production node dist/main

node_modules/@types/koa/index.d.ts(24,57): error TS7016: Could not find a declaration file for module 'http2'. '/Users/grayson/Desktop/cardiovascular-tracker-master/server/node_modules/http2/lib/index.js' implicitly has an 'any' type.
Try npm install @types/http2 if it exists or add a new declaration (.d.ts) file containing declare module 'http2';
src/lib/middlewares/validate.ts(14,58): error TS2345: Argument of type 'ErrorObject[] | null | undefined' is not assignable to parameter of type 'ErrorObject[] | undefined'.
Type 'null' is not assignable to type 'ErrorObject[] | undefined'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: tsc && NODE_ENV=production node dist/main
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start 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/grayson/.npm/_logs/2018-10-26T13_15_58_848Z-debug.log

from cardiovascular-tracker.

hjkcai avatar hjkcai commented on June 5, 2024

把 server/src/lib/middlewares/validate.ts 的 14 行的 throw new ValidationFailureError(ajv.errorsText(validator.errors)) 改为 throw new ValidationFailureError(ajv.errorsText(validator.errors) as any)

在 server/tsconfig.json 里面加一配置项 skipLibCheck 为 true

from cardiovascular-tracker.

jsjzyzc avatar jsjzyzc commented on June 5, 2024

[email protected] start /Users/grayson/Desktop/cardiovascular-tracker-master/server
tsc && NODE_ENV=production node dist/main

src/lib/middlewares/validate.ts(14,58): error TS2345: Argument of type 'ErrorObject[] | null | undefined' is not assignable to parameter of type 'ErrorObject[] | undefined'.
Type 'null' is not assignable to type 'ErrorObject[] | undefined'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: tsc && NODE_ENV=production node dist/main
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start 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/grayson/.npm/_logs/2018-10-26T13_29_21_200Z-debug.log

from cardiovascular-tracker.

hjkcai avatar hjkcai commented on June 5, 2024

ts报错的地方你都加个 any 就好了,很简单的😂

from cardiovascular-tracker.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.