webpack 路径错误 运行错误,在视频08:35的时候运行

来源:4-2 使用 babel-loader 转换 ES6 代码(上)

A回不去的曾经

2018-03-13 21:43

 npm run webpack

> webpack-loader@1.0.0 webpack F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader

> webpack --config webpack.config.js --progress --display-modules --colors --display-reason


F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\webpack.js:237

                                throw err;

                                ^


ReferenceError: path is not defined

    at Object.<anonymous> (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\webpack.config.js:13:8)

    at Module._compile (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)

    at Object.Module._extensions..js (module.js:671:10)

    at Module.load (module.js:573:32)

    at tryModuleLoad (module.js:513:12)

    at Function.Module._load (module.js:505:3)

    at Module.require (module.js:604:17)

    at require (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)

    at WEBPACK_OPTIONS (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\convert-argv.js:133:13)

    at requireConfig (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\convert-argv.js:135:6)

    at F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\convert-argv.js:142:17

    at Array.forEach (<anonymous>)

    at module.exports (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\convert-argv.js:140:15)

    at yargs.parse (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\webpack.js:234:39)

    at Object.parse (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\yargs\yargs.js:543:18)

    at F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\webpack.js:212:8

    at Object.<anonymous> (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack-cli\bin\webpack.js:502:3)

    at Module._compile (module.js:660:30)

    at Object.Module._extensions..js (module.js:671:10)

    at Module.load (module.js:573:32)

    at tryModuleLoad (module.js:513:12)

    at Function.Module._load (module.js:505:3)

    at Module.require (module.js:604:17)

    at require (internal/module.js:11:18)

    at Object.<anonymous> (F:\前端学习集合\案例\完整项目开发 慕课网\imooc\webpack-loader\node_modules\webpack\bin\webpack.js:12:2)

    at Module._compile (module.js:660:30)

    at Object.Module._extensions..js (module.js:671:10)

    at Module.load (module.js:573:32)

    at tryModuleLoad (module.js:513:12)

    at Function.Module._load (module.js:505:3)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

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

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the webpack-loader@1.0.0 webpack 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!     C:\Users\29176\AppData\Roaming\npm-cache\_logs\2018-03-13T13_41_28_552Z-debug.log


写回答 关注

1回答

  • lxd123
    2018-03-14 16:40:07

    config配置

    http://img.mukewang.com/5aa8dfe2000195b807260575.jpg

webpack深入与实战

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

86561 学习 · 721 问题

查看课程

相似问题