位置: IT常识 - 正文

vue项目打包失败问题记录(vue打包后请求不到数据)

编辑:rootadmin
vue项目打包失败问题记录

推荐整理分享vue项目打包失败问题记录(vue打包后请求不到数据),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:vue 打包问题,vue3打包后报错,vue项目打包过大,vue打包后请求不到数据,vue项目打包过大,vue项目打包后还能修改吗,vue项目打包过大,vue3打包后报错,内容如对您有帮助,希望把文章链接给更多的朋友!

项目"vue": "^2.7.14"版本

起因:项目里安装了openlayers最新版本的地图插件,打包会成功,但是打包页面会有红色提示

          刚开始根据红色提示百度找到相同错误的方法提供了的一系列提示安装啊,卸载,装了   

          node-modules,又卸了来来回回搞了好几遍没用,因为当时也不知道什么原因, 网上粘贴

         一顿操作几遍后,成功的变成下面这种错误提示,最重要的是打包不会成功。

报错粘贴的内容

> vue-admin@1.0.0 build D:\survey_institute\construction > node build/build.js

npm does not support Node.js v14.11.0 You should probably upgrade to a newer version of node as we can't make any promises that npm will work with this version. You can find the latest version at https://nodejs.org/ npm WARN config cache-max This option has been deprecated in favor of `--prefer-online` npm WARN config cache-min This option has been deprecated in favor of `--prefer-offline`. npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or npm WARN config `--include=optional` to include them. npm WARN config npm WARN config     Default value does install optional deps unless otherwise omitted. npm WARN config shrinkwrap Use the --package-lock setting instead. npm WARN config sso-poll-frequency The --auth-type method of SSO/SAML/OAuth will be removed in a future npm WARN config version of npm in favor of web-based login. npm WARN config sso-type The --auth-type method of SSO/SAML/OAuth will be removed in a future npm WARN config version of npm in favor of web-based login. npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special npm WARN config location in the cache, and they are managed by npm WARN config     [`cacache`](http://npm.im/cacache). - building for production...(node:3884) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) (node:3884) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'find' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'head' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'set' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'test' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'to' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency (node:3884) Warning: Accessing non-existent property 'which' of module exports inside circular dependency | building for production...(node:3884) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils. - building for production...(node:3884) DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead. \ building for production... Starting to optimize CSS... Processing static/css/app.db377778205ecaa3facd8be79f3f9c84.css... D:\survey_institute\construction\node_modules\optimize-css-assets-webpack-plugin\index.js:31   return this.options.cssProcessor.process(css, Object.assign({ to: assetName }, this.options.cssProcessorOptions));                                    ^

TypeError: this.options.cssProcessor.process is not a function     at OptimizeCssAssetsPlugin.processCss (D:\survey_institute\construction\node_modules\optimize-css-assets-webpack-plugin\index.js:31:36)     at D:\survey_institute\construction\node_modules\optimize-css-assets-webpack-plugin\index.js:69:12     at Function.each (D:\survey_institute\construction\node_modules\underscore\underscore-node-f.cjs:1323:7)     at Compiler.<anonymous> (D:\survey_institute\construction\node_modules\optimize-css-assets-webpack-plugin\index.js:58:7)     at Compiler.applyPluginsAsyncSeries (D:\survey_institute\construction\node_modules\tapable\lib\Tapable.js:206:13)     at Compiler.emitAssets (D:\survey_institute\construction\node_modules\webpack\lib\Compiler.js:354:8)     at onCompiled (D:\survey_institute\construction\node_modules\webpack\lib\Compiler.js:240:9)     at D:\survey_institute\construction\node_modules\webpack\lib\Compiler.js:510:14     at next (D:\survey_institute\construction\node_modules\tapable\lib\Tapable.js:202:11)     at Compiler.<anonymous> (D:\survey_institute\construction\node_modules\webpack\lib\CachePlugin.js:78:5)     at Compiler.applyPluginsAsyncSeries (D:\survey_institute\construction\node_modules\tapable\lib\Tapable.js:206:13)     at D:\survey_institute\construction\node_modules\webpack\lib\Compiler.js:507:11     at Compilation.applyPluginsAsyncSeries (D:\survey_institute\construction\node_modules\tapable\lib\Tapable.js:195:46)     at D:\survey_institute\construction\node_modules\webpack\lib\Compilation.js:683:19     at Compilation.applyPluginsAsyncSeries (D:\survey_institute\construction\node_modules\tapable\lib\Tapable.js:195:46)     at D:\survey_institute\construction\node_modules\webpack\lib\Compilation.js:674:11 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! vue-admin@1.0.0 build: `node build/build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the vue-admin@1.0.0 build 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:\Program Files\nodejs\node_cache\_logs\2022-11-16T01_47_31_678Z-debug.log  

1.首先解决的是

 我查看了我的node版本

vue项目打包失败问题记录(vue打包后请求不到数据)

与官网显示的node版本是对应的

详细官网  

https://nodejs.org/zh-cn/download/releases/

至于为什么出现这个

是我首先粘贴了这个问题去往了百度,安装了一个npm @laster 坑了我一把,很明显我的package.json的内容里多一个npm的版本8点多,这就造成我的项目能启动,但是打包一直再报版本不符合,首先卸载了npm 版本8.19.3,不会有npm does not support Node.js 版本了,

2.又来到了this.options.cssProcessor.process is not a function

 网上找了一大堆方法,

什么在项目依赖 node_modules 里面找到 optimize-css-assets-webpack-plugin依赖删除 然后重新 npm i 这方法可能管用,但是在我的项目丝毫不起作用,这玩意我也是卸载安装好多遍,毙掉此方法找到build文件目录下的build*webpack.prod.conf.js* 注释掉// const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') // new OptimizeCSSPlugin({// cssProcessorOptions: {// safe: true// }// }),

这两串代码我也注释过;没啥用,我又放开了;

后面找出原因估计就是因为刚开始打包的错误提示安装了一些影响项目的插件,项目能启动就是打不了包,

最后找到我类似这个项目的其他项目能打包成功的package.json复制到我这个项目,删掉node-modules,重新npm i,能打包成功,回到我刚开始的打包成功,有错误提示,最后的最后降低我的openlayers版本,最后package.json里面内容对比(编辑器里为我项目现在package.json,txt文本为我之前打包失败的package.json),txt文本里有的可能就是我按照错误提示安装没有必要的东西,

有时候安装的插件版本过高会导致打包失败或者有错误提示,千万别粘贴类似于

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! vue-admin@1.0.0 build: `node build/build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the vue-admin@1.0.0 build 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:\Program Files\nodejs\node_cache\_logs\2022-11-16T01_47_31_678Z-debug.log

那种红色错误提示去百度安装一些无用的东西,然后坑到你怀疑人生,你只需要降低版本就好了。

本文链接地址:https://www.jiuchutong.com/zhishi/293009.html 转载请保留说明!

上一篇:Notojima岛附近的牡蛎养殖场,日本石川县 (© divedog/Shutterstock)

下一篇:CSS 如何实现文字渐变色 ?(css如何实现文字环绕)

  • 华为鸿蒙HarmonyOS2第四批公测时间(华为鸿蒙harmonyos官网,刷机包,安装到U盘)

    华为鸿蒙HarmonyOS2第四批公测时间(华为鸿蒙harmonyos官网,刷机包,安装到U盘)

  • 提高电脑的运行内存(提高电脑的运行速度)(提高电脑的运行速度,保障)

    提高电脑的运行内存(提高电脑的运行速度)(提高电脑的运行速度,保障)

  • 闲鱼见面交易怎么改成物流(闲鱼见面交易怎么设置)

    闲鱼见面交易怎么改成物流(闲鱼见面交易怎么设置)

  • 怎么把qq头像挂件去掉(怎么把qq头像挂件取了)

    怎么把qq头像挂件去掉(怎么把qq头像挂件取了)

  • 如何让微信暂时不计步(如何让微信暂时封号)

    如何让微信暂时不计步(如何让微信暂时封号)

  • 小米9微信视频通话不能美颜(小米9微信视频对方听不到声音)

    小米9微信视频通话不能美颜(小米9微信视频对方听不到声音)

  • 聊天记录删了怎么恢复聊天记录(聊天记录删了怎么查找回来)

    聊天记录删了怎么恢复聊天记录(聊天记录删了怎么查找回来)

  • 腾讯课堂看回放可以补时间吗(腾讯课堂看回放老师知道吗)

    腾讯课堂看回放可以补时间吗(腾讯课堂看回放老师知道吗)

  • 苹果手表5听不了语音(苹果手表听不了语音)

    苹果手表5听不了语音(苹果手表听不了语音)

  • 苹果手机音质怎么调节(苹果手机音质怎么设置像立体声)

    苹果手机音质怎么调节(苹果手机音质怎么设置像立体声)

  • 全民k歌突然打不开了(全民k歌为什么)

    全民k歌突然打不开了(全民k歌为什么)

  • 步步高和vivo什么关系(步步高和vivo是一个牌子吗)

    步步高和vivo什么关系(步步高和vivo是一个牌子吗)

  • 淘宝匿名购买和不匿名有什么区别(淘宝匿名购买的意思)

    淘宝匿名购买和不匿名有什么区别(淘宝匿名购买的意思)

  • 荣耀30参数详细参数(荣耀30参数详细价格)

    荣耀30参数详细参数(荣耀30参数详细价格)

  • 字长是32位的计算机是指(字长32位是多少字节)

    字长是32位的计算机是指(字长32位是多少字节)

  • 抖音动态壁纸怎么设置锁屏(抖音动态壁纸怎么切换锁屏和主屏)

    抖音动态壁纸怎么设置锁屏(抖音动态壁纸怎么切换锁屏和主屏)

  • 华为nova5pro有红外线吗(华为nova5pro有红外线遥控吗?)

    华为nova5pro有红外线吗(华为nova5pro有红外线遥控吗?)

  • 磁盘属于什么媒体(磁盘属于内存储器还是外存储器)

    磁盘属于什么媒体(磁盘属于内存储器还是外存储器)

  • 拼多多直播在哪里看(拼多多直播在哪里开)

    拼多多直播在哪里看(拼多多直播在哪里开)

  • 红米截屏怎么截图(红米note12怎么截屏)

    红米截屏怎么截图(红米note12怎么截屏)

  • 苹果7p免提灰色按不了(苹果7p免提灰色怎么回事)

    苹果7p免提灰色按不了(苹果7p免提灰色怎么回事)

  • oppor9支持nfc功能吗(oppor9m支持nfc功能)

    oppor9支持nfc功能吗(oppor9m支持nfc功能)

  • 微信聊天删了能恢复吗(微信聊天删了能恢复出来吗)

    微信聊天删了能恢复吗(微信聊天删了能恢复出来吗)

  • airpods质保多久(airpods 质保)

    airpods质保多久(airpods 质保)

  • 在Linux系统中使用who和whoami命令获取用户信息(在linux系统中 用来存放系统所需)

    在Linux系统中使用who和whoami命令获取用户信息(在linux系统中 用来存放系统所需)

  • lscpu命令  显示CPU架构信息

    lscpu命令 显示CPU架构信息

  • 应交税费是什么会计科目
  • 积分抵现是什么意思
  • 现金流量表中的销售商品提供劳务收到的现金
  • 收到税费返还是什么现金流量
  • 应交增值税销项税额借贷方向
  • 负数发票要给购票人吗
  • 火车票的进项税额
  • 现金流量怎么影响股票价值
  • 小微企业免交增值税,月末结转到营业外收入吗
  • 企业股权转让留存收益可以扣除吗
  • 网上缴税后会有发票吗
  • 应付账款不用付怎么处理
  • 企业事故赔偿支出可以抵税吗
  • 房地产开发成本和开发费用的区别
  • 总公司名义取得的进项发票可以在分公司抵扣吗?
  • 福利费要交个人税吗
  • 普票和专票的税率分别是多少
  • 7月1日起税务新规
  • 净利润和毛利润的计算公式
  • 公积金超出上限部分
  • 开票的时候开票人是管理员
  • 资金账簿印花税税率
  • 购买厂房可以一次买卖吗
  • 收取对方损失赔偿
  • 广告公司怎么结转成本
  • 对外捐赠会计和税法差异调整
  • 总资产报酬率怎么查
  • 标书费没有发票
  • 系统太多怎么办
  • PHP:stream_get_contents()的用法_Stream函数
  • 工程结算的编制方法
  • 没有购入发票可以开出发票
  • 企业财务管理内部控制问题与应对策略
  • 个人所得税计提基数公式
  • 非营利组织增值税
  • thinkphp i方法
  • 员工旅游费的税率是多少
  • thinkphp消息通知
  • 转出未交增值税怎么算
  • linux系统中mysql数据库的导入和导出
  • 税务局报季度税
  • 固定资产是怎么算出来的
  • 小规模进项是专票销项是普票可以抵扣吗
  • 固定资产减值损失影响营业利润吗
  • 异地预缴的企业所得税
  • 公允价值怎么读
  • 公对公打款发票
  • 增值税专用发票有几联?
  • 2、开办费用计入哪个账户?
  • 企业购进生产用品税率
  • 劳务派遣如何做线上业务
  • 购买材料没开票怎么做账
  • 行政事业单位基本户核算内容
  • centos7如何设置ssh免密登陆
  • win8应用程序无法正常启动
  • 让mac桌面变整洁的方法
  • azipmd5.exe是什么
  • Windows update更新服务启动被拒绝访问
  • 进程mmc.exe
  • windos8怎么样
  • WindowsPE与WindowsRE有什么区别
  • win8 网络连接
  • dx12最新版本
  • linux系统设置网络
  • Linux VPN 出现 807 错误的解决办法
  • glrotatef函数
  • 日亚海淘官网
  • perl 文件
  • 深入了解是啥意思
  • unity中assets文件夹的作用
  • [置顶]马粥街残酷史
  • 安卓手机都这样
  • python快速排序法
  • 完美解决usb电涌15秒后关机
  • python拷贝列表
  • 江苏税务电子税务局电话号码
  • 12123怎么上传交强险
  • 第2类医疗器械许可证代办
  • 小汽车碰撞游戏视频
  • 降低税率的坏处
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设