老师报错什么意思

来源:2-2 webpack配置的 entry 和 output new

webFE

2018-01-28 22:33

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

 - configuration.output.path: The provided value "./dist/js" is not an absolute path!

   -> The output directory as **absolute path** (required).


npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "webpack"

npm ERR! node v6.9.2

npm ERR! npm  v3.10.9

npm ERR! code ELIFECYCLE

npm ERR! webpack-demo@1.0.0 webpack: `webpack --config webpack.config.js --progress --display-modules --colors --display-reasons`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the webpack-demo@1.0.0 webpack script 'webpack --config webpack.config.js --progress --display-modules --colors --display-reasons'.

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 webpack-demo package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     webpack --config webpack.config.js --progress --display-modules --colors --display-reasons

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!     npm bugs webpack-demo

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls webpack-demo

npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:

npm ERR!     D:\imooc\webpack-demo\npm-debug.log


写回答 关注

3回答

  • 慕粉1804033883
    2018-02-27 16:37:52

    我也遇到了 得亏扫了一下官网 挺多问题需要解决的

  • 慕粉17720507621
    2018-02-02 14:45:02

    http://img2.mukewang.com/5a7408b80001428107490304.jpg

    如上图配置即可

  • LavanSum
    2018-01-29 16:31:15

    报错的意思是:"./dist/js"不是一个绝对路径,你需要配一个绝对路径。

    1、在webpack配置文件顶部先引入node的路径模块文件  var path = require('path'); 

    2、再把路径改为 path.resolve(__dirname , "./dist/js")。 PS:__dirname前面是两个底部下划线,不是一个

webpack深入与实战

webpack实战教程,用真实项目带你探索 webpack 强大的功能

86561 学习 · 721 问题

查看课程

相似问题