Comments (5)
这个项目有点老了,很多 npm 包都已经更新了,所以就跪了
可以试一下临时解决方法:
- 删掉
node_modules
- 把
package.json
里面的^
全部替换成~
- 再试一下
from cardiovascular-tracker.
[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.
把 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.
[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.
ts报错的地方你都加个 any 就好了,很简单的😂
from cardiovascular-tracker.
Related Issues (2)
- login接口本地调试没法正常调用 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cardiovascular-tracker.