请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

在后台管理系统中的几个问题。

https://img1.sycdn.imooc.com//szimg/5a329b4a0001dff209040306.jpg

按照老师给的代码里的package.json一个个下载包搭建环境。唯独这个安装不了报错不知道如何解决。

使用webpack来打包后台管理的代码报错。

https://img1.sycdn.imooc.com//szimg/5a329bc90001a84f09000540.jpg

正在回答

3回答

Rosen 2017-12-15 14:13:25

还是有版本不对的插件,比如react-router课程里用的是2.x,把课程里的package.json文件内容换过来初始化一下试试

0 回复 有任何疑惑可以回复我~
  • 提问者 To_The_Moon #1
    原因是webpack版本低了。我安装课程里的package.json文件配的webpack2.2.1。还有一个问题,为啥我全局安装的3.X的版本并不起作用。所以我配置的时候还是按本地安装来的。
    回复 有任何疑惑可以回复我~ 2017-12-15 19:05:28
  • Rosen 回复 提问者 To_The_Moon #2
    webpack有本地的版本,会优先使用本地版本的,全局版本并不会生效
    回复 有任何疑惑可以回复我~ 2017-12-16 19:31:40
提问者 To_The_Moon 2017-12-14 23:44:10

C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\extract-text-webpack-plugin\dist\index.js:188

            chunk.sortModules();

                  ^


TypeError: chunk.sortModules is not a function

    at C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\extract-text-webpack-plugin\dist\index.js:188:19

    at C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\async\dist\async.js:3096:16

    at eachOfArrayLike (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\async\dist\async.js:1055:9)

    at eachOf (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\async\dist\async.js:1103:5)

    at Object.eachLimit (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\async\dist\async.js:3158:5)

    at Compilation.<anonymous> (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\extract-text-webpack-plugin\dist\index.js:184:27)

    at Compilation.applyPluginsAsyncSeries (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\tapable\lib\Tapable.js:206:13)

    at Compilation.seal (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\webpack\lib\Compilation.js:579:8)

    at C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\webpack\lib\Compiler.js:493:16

    at C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\tapable\lib\Tapable.js:289:11

    at _addModuleChain (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\webpack\lib\Compilation.js:481:11)

    at processModuleDependencies.err (C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\webpack\lib\Compilation.js:452:13)

    at _combinedTickCallback (internal/process/next_tick.js:131:7)

    at process._tickCallback (internal/process/next_tick.js:180:9)


0 回复 有任何疑惑可以回复我~
提问者 To_The_Moon 2017-12-14 23:43:33

npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0 but none was installed.

npm WARN react-router@4.2.0 requires a peer of react@>=15 but none was installed.

npm WARN admin-fe@1.0.0 No repository field.


npm ERR! path C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\.staging\sb-admin-2-ba3d4c10\vendor\font-awesome\fonts\fontawesome-webfont.woff

npm ERR! code ENOENT

npm ERR! errno -4058

npm ERR! syscall utime

npm ERR! enoent ENOENT: no such file or directory, utime 'C:\Users\Anchan\GitHub\happymmall\admin-fe\node_modules\.staging\sb-admin-2-ba3d4c10\vendor\font-awesome\fonts\fontawesome-webfont.woff'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\Anchan\AppData\Roaming\npm-cache\_logs\2017-12-14T15_24_08_672Z-debug.log


0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号