多页应用webpack配置记录

本文详细介绍了在安装extract-text-webpack-plugin时遇到的版本不匹配问题及解决方案,包括使用特定版本的插件和清理缓存后重新安装,以及解决因node版本和npm不匹配导致的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

遇到的问题

  1. extract-text-webpack-plugin 安装时版本不对,解决:
cnpm install --save-dev extract-text-webpack-plugin@4.0.0-beta.0
  1. node版本和npm不配,cnpm cache clean,然后cnpm install.
module.js:549
    throw err;
    ^

Error: Cannot find module 'async'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (F:\ZWDOC\base20190107\node_modules\_extract-text-webpack-plugin@4.0.0-beta.0@extract-text-webpack-plugin\dist\index.js:21:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! base@1.0.0 dev: `cross-env WEBPACK_ENV=dev webpack-dev-server --inline --port 8088`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the base@1.0.0 dev 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\gu\AppData\Roaming\npm-cache\_logs\2019-01-07T02_36_01_044Z-debug.log
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值