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

[HELP] ビルドできない #45

Closed
mzch opened this issue Nov 11, 2019 · 8 comments
Closed

[HELP] ビルドできない #45

mzch opened this issue Nov 11, 2019 · 8 comments

Comments

@mzch
Copy link

mzch commented Nov 11, 2019

npm install 後、npm run build すると、以下のエラーとなります。解決法はありませんか。

node.js : v12.1.0

> kiwi@0.0.4 tsc /srv/kiwi/kiwi
> tsc

node_modules/@types/koa-compose/index.d.ts:53:49 - error TS2694: Namespace '"/srv/kiwi/kiwi/node_modules/@types/koa/index.d.ts"' has no exported member 'Next'.

53     type Middleware<T> = (context: T, next: Koa.Next) => any;
                                                   ~~~~

node_modules/@types/koa-compose/index.d.ts:54:58 - error TS2694: Namespace '"/srv/kiwi/kiwi/node_modules/@types/koa/index.d.ts"' has no exported member 'Next'.

54     type ComposedMiddleware<T> = (context: T, next?: Koa.Next) => Promise<void>;
                                                            ~~~~


Found 2 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! kiwi@0.0.4 tsc: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the kiwi@0.0.4 tsc 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!     /srv/kiwi/.npm/_logs/2019-11-11T15_36_27_185Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! kiwi@0.0.4 build: `npm run webpack && npm run tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the kiwi@0.0.4 build 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!     /srv/kiwi/.npm/_logs/2019-11-11T15_36_27_330Z-debug.log

yarn を使った場合の npm run build の結果は、以下です。

> kiwi@0.0.4 tsc /srv/kiwi/kiwi
> tsc

node_modules/@types/vfile/index.d.ts:11:31 - error TS7016: Could not find a declaration file for module 'vfile-message'. '/srv/kiwi/kiwi/node_modules/vfile-message/index.js' implicitly has an 'any' type.
  Try `npm install @types/vfile-message` if it exists or add a new declaration (.d.ts) file containing `declare module 'vfile-message';`

11 import * as vfileMessage from 'vfile-message';
                                 ~~~~~~~~~~~~~~~

src/server/index.ts:47:24 - error TS2345: Argument of type 'Application<any, {}>' is not assignable to parameter of type 'import("/srv/kiwi/kiwi/node_modules/@types/koa-compose/node_modules/@types/koa/index.d.ts")<DefaultState, DefaultContext> | Middleware<ParameterizedContext<DefaultState, DefaultContext>>'.
  Type 'Application<any, {}>' is not assignable to type 'import("/srv/kiwi/kiwi/node_modules/@types/koa-compose/node_modules/@types/koa/index.d.ts")<DefaultState, DefaultContext>'.
    Types of property 'middleware' are incompatible.
      Type 'Middleware<ParameterizedContext<any, {}>>[]' is not assignable to type 'Middleware<ParameterizedContext<DefaultState, DefaultContext>>[]'.
        Type 'Middleware<ParameterizedContext<any, {}>>' is not assignable to type 'Middleware<ParameterizedContext<DefaultState, DefaultContext>>'.
          Type 'ParameterizedContext<DefaultState, DefaultContext>' is not assignable to type 'ParameterizedContext<any, {}>'.
            Type 'ParameterizedContext<DefaultState, DefaultContext>' is not assignable to type '{ app: Application<any, {}>; request: Request; response: Response; req: IncomingMessage; res: ServerResponse; originalUrl: string; cookies: Cookies; accept: Accepts; state: any; respond?: boolean | undefined; }'.
              Types of property 'app' are incompatible.
                Type 'import("/srv/kiwi/kiwi/node_modules/@types/koa-compose/node_modules/@types/koa/index.d.ts")<DefaultState, DefaultContext>' is not assignable to type 'Application<any, {}>'.
                  Types of property 'middleware' are incompatible.
                    Type 'Middleware<ParameterizedContext<DefaultState, DefaultContext>>[]' is not assignable to type 'Middleware<ParameterizedContext<any, {}>>[]'.
                      Type 'Middleware<ParameterizedContext<DefaultState, DefaultContext>>' is not assignable to type 'Middleware<ParameterizedContext<any, {}>>'.
                        Type 'ParameterizedContext<any, {}>' is not assignable to type 'ParameterizedContext<DefaultState, DefaultContext>'.
                          Type 'ParameterizedContext<any, {}>' is not assignable to type 'ExtendableContext'.
                            Types of property 'request' are incompatible.
                              Property 'rawBody' is missing in type 'import("/srv/kiwi/kiwi/node_modules/@types/koa/index").Request' but required in type 'import("/srv/kiwi/kiwi/node_modules/@types/koa-compose/node_modules/@types/koa/index.d.ts").Request'.

47 app.use(mount('/_api', apiServer));
                          ~~~~~~~~~

  node_modules/@types/koa-bodyparser/index.d.ts:25:9
    25         rawBody: string;
               ~~~~~~~
    'rawBody' is declared here.

src/server/web/index.ts:57:13 - error TS2339: Property 'render' does not exist on type 'ParameterizedContext<any, IRouterParamContext<any, {}>>'.

57  	await ctx.render('page', {
    	          ~~~~~~

src/server/web/index.ts:62:13 - error TS2339: Property 'render' does not exist on type 'ParameterizedContext<any, IRouterParamContext<any, {}>>'.

62  	await ctx.render('base', {
    	          ~~~~~~


Found 4 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! kiwi@0.0.4 tsc: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the kiwi@0.0.4 tsc 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!     /srv/kiwi/.npm/_logs/2019-11-11T16_16_11_502Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! kiwi@0.0.4 build: `npm run webpack && npm run tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the kiwi@0.0.4 build 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!     /srv/kiwi/.npm/_logs/2019-11-11T16_16_11_938Z-debug.log
@u1-liquid

This comment has been minimized.

@syuilo
Copy link
Owner

syuilo commented Nov 11, 2019

依存関係更新してみますね、多分それで直ると思います
しばらくお待ちください

@syuilo
Copy link
Owner

syuilo commented Nov 11, 2019

0.1.0 をリリースしました。これでビルドできると思います

@mzch
Copy link
Author

mzch commented Nov 11, 2019

通りました!ありがとうございます。

@mzch mzch closed this as completed Nov 11, 2019
@mzch
Copy link
Author

mzch commented Nov 12, 2019

npm run ormconfig がエラーになるんですけど、これはしなくてもよいのでしょうか?

> kiwi@0.1.0 ormconfig /srv/kiwi/kiwi
> node ./built/ormconfig.js

internal/modules/cjs/loader.js:613
    throw err;
    ^

Error: Cannot find module '/srv/kiwi/kiwi/built/ormconfig.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
    at Function.Module._load (internal/modules/cjs/loader.js:526:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:824:10)
    at internal/main/run_main_module.js:17:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kiwi@0.1.0 ormconfig: `node ./built/ormconfig.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kiwi@0.1.0 ormconfig 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!     /srv/kiwi/.npm/_logs/2019-11-12T00_00_16_852Z-debug.log

あと、WIKI の設定ページでの変更が反映されないのですが…

@mzch mzch reopened this Nov 12, 2019
@mzch
Copy link
Author

mzch commented Nov 12, 2019

すみません。変更は再起動したら反映されました。

@syuilo
Copy link
Owner

syuilo commented Nov 12, 2019

npm run ormconfigは廃止されて、npm run init(データベース初期化)とnpm run migrate(データベース移行)になりました。

@mzch
Copy link
Author

mzch commented Nov 12, 2019

よかった。ありがとうございます。

@mzch mzch closed this as completed Nov 12, 2019
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

3 participants