Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

遇到一个ts编译问题,排查了好久,记录一下,给后来者遇到的人 #17

Open
phper-qiu opened this issue Mar 30, 2019 · 1 comment

Comments

@phper-qiu
Copy link

nodepress@3.0.0 start:dev /Applications/MAMP/htdocs/nodepress
NODE_ENV=development nodemon

[nodemon] 1.18.7
[nodemon] to restart at any time, enter rs
[nodemon] watching: /Applications/MAMP/htdocs/nodepress/src/**/*
[nodemon] starting ts-node -r tsconfig-paths/register src/main.ts

/Applications/MAMP/htdocs/nodepress/node_modules/ts-node/src/index.ts:261
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
src/modules/expansion/expansion.service.qiniu.ts(24,42): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.
src/modules/expansion/expansion.service.qiniu.ts(25,47): error TS2322: Type 'unknown' is not assignable to type 'string'.

是需要配七牛的配置app.config.ts

export const QINIU = {
accessKey: argv.qn_accessKey || 'your access key',
secretKey: argv.qn_secretKey || 'your secret key',
bucket: argv.qn_bucket || 'nodepress',
origin: argv.qn_origin || 'http://nodepress.u.qiniudn.com',
uploadURL: argv.qn_uploadURL || 'http://up.qiniu.com/',
};

@surmon-china
Copy link
Owner

类型问题,已处理,已更新

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants