2017-04-12 8 views
-2
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. 
- configuration.output.path: The provided value "" is not an absolute path! 
npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! [email protected] start: `webpack-dev-server --hot` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'webpack-dev-server --hot'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the helloworldapp package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  webpack-dev-server --hot 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs helloworldapp 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls helloworldapp 
npm ERR! There is likely additional logging output above. 

npm ERR! A complete log of this run can be found in: 
npm ERR!  /home/aakash/.npm/_logs/2017-04-12T09_51_55_188Z-debug.log 
+1

エラーメッセージはかなり明確です。設定ファイルの 'output.path'が設定されていません。 –

+0

[https://www.tutorialspoint.com/reactjs/reactjs_environment_setup.html]から環境設定を行っています。 私は上記と同じフォルダー構造を作成しましたが、私はconfiguration.output.pathエラーより上になっています –

+0

そのリンクは存在しません - あなたはそれを間違って入力しましたか?いずれにしても、webpack.config.jsを質問に追加する必要があります。問題がどこにあるのかは間違いありません。 –

答えて

0

エラーメッセージが言うように:

configuration.output.path: The provided value "" is not an absolute path! 

その代わりにoutput.pathの実際の値の空白文字列を表示していますなぜ、私はわかりません - しかし、いずれかの方法は、お使いの設定が間違っています。 output.pathの値は絶対パスになるようにになり、相対パスとして設定されます。

人々がこの問題を回避通常の方法ではそうのように、ノードからpathモジュールをインポートし、path.joinを使用することです:

var path = require('path'); 

module.exports = { 
    /// ... 

    output: { 
     path: path.resolve(__dirname, "dist"), 
     filename: "index.js" 
    }, 

    // ... 
}; 

しかし、あなただけのルートに出力ファイルをダンプしようとしているので、ディレクトリを削除するだけで、このようにすることができます:

// no path import needed 

module.exports = { 
    // ... 

    output: { 
     path: __dirname, 
     filename: "index.js" 
    }, 

    // ... 
};