2017-12-05 1 views
0

package.jsonが

  • ポイをスニペットポイプロジェクトのカルマのテストのセットアップについてのヘルプが必要です^ 0.1.0
  • カルマ・モカ:^ 1.3.0
  • カルマ-のWebPACK:^ 2.0.6
  • モカ:^ 4.0.1
  • ポイ・プリセット・カルマ:^ 9.2.2
  • のWebPACK:私は、コマンドポイテストを実行すると、^ 3.9.1

poi.config.json

module.exports = { 
    presets: [ 
     require('poi-preset-karma')({ 
      port: '5050' 
     }) 
    ], 
    webpack(config) { 
     config.devtool = 'source-map'; 
     config.watchOptions = { 
      ignored: '/node_modules', 
      poll: 1000, 
     }; 
     config.stats = { 
      depth: true, 
      warnings: true, 
     }; 
     return config; 
    }, 
    define: { 
     __VERSION__: require('./package.json').version 
    }, 
    html: { 
     title: 'Platform', 
     template:'index.ejs' 
    } 
}; 

は、私は次のような出力が得られます。

> Using main field in package.json as entry point 
> Bundling with Webpack 3.9.1 
04 12 2017 22:41:20.194:WARN [config]: "/" is proxied, you should probably change urlRoot to avoid conflicts 
TypeError: Cannot read property 'type' of undefined 
    at Function.formatSchema (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:83:13) 
    at formatInnerSchema (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:78:54) 
    at Function.formatSchema (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:106:15) 
    at getSchemaPartText (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:36:49) 
    at Function.formatValidationError (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:188:49) 
    at WebpackOptionsValidationError.message.Invalid configuration object. .Webpack has been initialised using a configuration object that does not match the API schema. 
.validationErrors.map.err (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:68:77) 
    at Array.map (<anonymous>) 
    at new WebpackOptionsValidationError (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:68:21) 
    at webpack (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/webpack.js:19:9) 
    at Plugin (/home/rshighto/btg/peeprFrontend/node_modules/karma-webpack/lib/karma-webpack.js:67:16) 
    at invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:75:15) 
    at Array.instantiate (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:59:20) 
    at get (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:48:43) 
    at /home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:71:14 
    at Array.map (<anonymous>) 
    at Array.invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:70:31) 
    at Injector.get (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:48:43) 
    at instantiatePreprocessor (/home/rshighto/btg/peeprFrontend/node_modules/karma/lib/preprocessor.js:55:20) 
    at Array.forEach (<anonymous>) 
    at createPreprocessor (/home/rshighto/btg/peeprFrontend/node_modules/karma/lib/preprocessor.js:74:20) 
    at Array.invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:75:15) 
    at get (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:48:43) 
    at /home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:71:14 
    at Array.map (<anonymous>) 
    at Injector.invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:70:31) 
    at Server.start (/home/rshighto/btg/peeprFrontend/node_modules/karma/lib/server.js:103:18) 
    at Ware.poi.run.webpackConfig (/home/rshighto/btg/peeprFrontend/node_modules/poi-preset-karma/index.js:133:14) 
    at Ware.<anonymous> (/home/rshighto/btg/peeprFrontend/node_modules/wrap-fn/index.js:75:16) 
04 12 2017 22:41:21.406:ERROR [preprocess]: Can not load "webpack"! 
    TypeError: Cannot read property 'type' of undefined 
    at Function.formatSchema (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:83:13) 
    at formatInnerSchema (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:78:54) 
    at Function.formatSchema (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:106:15) 
    at getSchemaPartText (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:36:49) 
    at Function.formatValidationError (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:188:49) 
    at WebpackOptionsValidationError.message.Invalid configuration object. .Webpack has been initialised using a configuration object that does not match the API schema. 
.validationErrors.map.err (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:68:77) 
    at Array.map (<anonymous>) 
    at new WebpackOptionsValidationError (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/WebpackOptionsValidationError.js:68:21) 
    at webpack (/home/rshighto/btg/peeprFrontend/node_modules/webpack/lib/webpack.js:19:9) 
    at Plugin (/home/rshighto/btg/peeprFrontend/node_modules/karma-webpack/lib/karma-webpack.js:67:16) 
    at invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:75:15) 
    at Array.instantiate (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:59:20) 
    at get (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:48:43) 
    at /home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:71:14 
    at Array.map (<anonymous>) 
    at Array.invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:70:31) 
    at Injector.get (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:48:43) 
    at instantiatePreprocessor (/home/rshighto/btg/peeprFrontend/node_modules/karma/lib/preprocessor.js:55:20) 
    at Array.forEach (<anonymous>) 
    at createPreprocessor (/home/rshighto/btg/peeprFrontend/node_modules/karma/lib/preprocessor.js:74:20) 
    at Array.invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:75:15) 
    at get (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:48:43) 
    at /home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:71:14 
    at Array.map (<anonymous>) 
    at Injector.invoke (/home/rshighto/btg/peeprFrontend/node_modules/di/lib/injector.js:70:31) 
    at Server.start (/home/rshighto/btg/peeprFrontend/node_modules/karma/lib/server.js:103:18) 
    at Ware.poi.run.webpackConfig (/home/rshighto/btg/peeprFrontend/node_modules/poi-preset-karma/index.js:133:14) 
    at Ware.<anonymous> (/home/rshighto/btg/peeprFrontend/node_modules/wrap-fn/index.js:75:16) 

START: 
04 12 2017 22:41:21.653:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:5050/ 
04 12 2017 22:41:21.654:INFO [launcher]: Launching browser Chrome with unlimited concurrency 
04 12 2017 22:41:21.656:ERROR [karma]: Found 1 load error 

私が試しましたいくつかのwebpackコードを見て、何が欠落していたかを確認しましたが、わかりませんでした。問題のように、webpackは少なくとも1つのスキーマオプションが定義されると予想していますが、そうではありません。私はPOIのdevのサイトhttps://poi.js.org/#/の例を見てみましたが、何も見つかりませんでした。

誰もがこの問題に遭遇していないか、またはこの問題に遭遇していたことを知っていますか?

答えて

0

私はついにこの問題を乗り越えることができました。私は本当にカルマ - ウェブパックに依存していなかったと考えました。そこで私はそれを削除し、node_modules /を削除して、ローカルキャッシュをクリアしました。そして安全な側にいるために、私はノード9.0.0から8.9.1(lts)にダウングレードしました。