位置: 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如何实现文字环绕)

  • 顺丰速运电话查询物流(顺丰速运电话查询)(顺丰速运电话查询单号)

    顺丰速运电话查询物流(顺丰速运电话查询)(顺丰速运电话查询单号)

  • 华为nova5悬浮球怎么关闭(华为nova5悬浮球怎么开启)

    华为nova5悬浮球怎么关闭(华为nova5悬浮球怎么开启)

  • 苹果11屏幕什么材料(苹果11屏幕什么屏)

    苹果11屏幕什么材料(苹果11屏幕什么屏)

  • 计算器的clock键是什么键(计算器lock键是什么意思)

    计算器的clock键是什么键(计算器lock键是什么意思)

  • 快手直播一小时需要多少流量(快手直播一小时一个人都没进)

    快手直播一小时需要多少流量(快手直播一小时一个人都没进)

  • iphonexsmax 尺寸(iPhonexsmax尺寸和哪个iPhone一样)

    iphonexsmax 尺寸(iPhonexsmax尺寸和哪个iPhone一样)

  • 微信被一个人举报就能封号吗(微信被一个人举报后果)

    微信被一个人举报就能封号吗(微信被一个人举报后果)

  • 苹果手机一边喇叭不响(苹果手机一边喇叭没声音怎么办)

    苹果手机一边喇叭不响(苹果手机一边喇叭没声音怎么办)

  • airpods2和3的区别(airpods3与2的区别)

    airpods2和3的区别(airpods3与2的区别)

  • 苹果se是苹果几(苹果se是苹果几的手机)

    苹果se是苹果几(苹果se是苹果几的手机)

  • 手机信号变成2g怎么回事(手机信号变成2g了怎么改成4g)

    手机信号变成2g怎么回事(手机信号变成2g了怎么改成4g)

  • win10系统多少GB(win10系统多少个g够用)

    win10系统多少GB(win10系统多少个g够用)

  • 固态硬盘容量(固态硬盘容量检测)

    固态硬盘容量(固态硬盘容量检测)

  • word怎么把字体加粗(word怎么把字体调到最大)

    word怎么把字体加粗(word怎么把字体调到最大)

  • p30pro屏幕容易碎吗(华为p30pro屏幕容易碎吗)

    p30pro屏幕容易碎吗(华为p30pro屏幕容易碎吗)

  • 华硕笔记本内存条在哪个位置(华硕笔记本内存卡槽在哪里)

    华硕笔记本内存条在哪个位置(华硕笔记本内存卡槽在哪里)

  • 网络总是掉线,一会又好,断断续续。怎么回事(网络总是掉线怎么回事,重启又好了)

    网络总是掉线,一会又好,断断续续。怎么回事(网络总是掉线怎么回事,重启又好了)

  • 手机流量1g等于多少mb(手机流量1g等于多少mb电信)

    手机流量1g等于多少mb(手机流量1g等于多少mb电信)

  • 华为yalal10是什么手机(yalal10是华为什么型号手机)

    华为yalal10是什么手机(yalal10是华为什么型号手机)

  • 为啥抖音直播是黑屏(为啥抖音直播是开的,别人看不到)

    为啥抖音直播是黑屏(为啥抖音直播是开的,别人看不到)

  • vue视频怎么把字幕调大(如何在vue视频上写字)

    vue视频怎么把字幕调大(如何在vue视频上写字)

  • 同一个进程中的线程不共享的部分是(同一进程或不同进程内的线程都只能串行执行)

    同一个进程中的线程不共享的部分是(同一进程或不同进程内的线程都只能串行执行)

  • 淘宝省钱月卡怎么取消(淘宝省钱月卡怎么用最划算)

    淘宝省钱月卡怎么取消(淘宝省钱月卡怎么用最划算)

  • 抖音怎么设置自己的id在视频(抖音怎么设置自动关闭屏幕)

    抖音怎么设置自己的id在视频(抖音怎么设置自动关闭屏幕)

  • vivoy93什么时候上市的(vivoy93什么时候生产的)

    vivoy93什么时候上市的(vivoy93什么时候生产的)

  • 极联科外贸专用路由器怎么安装 极联科外贸专用路由器安装教程(geeklink 极联科技)

    极联科外贸专用路由器怎么安装 极联科外贸专用路由器安装教程(geeklink 极联科技)

  • HTTP/1.1 XCache header field

    HTTP/1.1 XCache header field

  • 新会计准则低值易耗品属于哪个科目
  • 月初没报税可以领发票吗
  • 营业收入包括投资净收益吗
  • 原材料月末有余额吗
  • 培训发生的住宿费 差旅费可以放入职工教育经费吗
  • 申报更正日期改变会导致逾期申报吗
  • 房地产公司的利润怎么分析
  • 外汇结汇的方法有哪些呢?
  • 产品成本核算的一般程序
  • 个人所得税0申报操作流程
  • 不需要抵扣的怎么直接进费用
  • 应交增值税最后到哪了
  • 资产处置税务风险有哪些
  • 所得税季报收入是全年吗
  • 一般纳税人购进原材料支付的增值税
  • 小规模的成本票
  • 工程物资建设期间盘盈盘亏
  • 公司购买的办公桌椅属于固定资产吗
  • 如何从零开始制作地下偶像
  • 年末存货怎么计算
  • 疫情期间企业贷款利率多少
  • 消费税和购置税怎么算
  • 赠送客户的商品怎么入账
  • linux直接运行jar
  • 分期付款购买的商品
  • erl.exe是什么进程
  • dell oemdrv
  • 关于企业发生的手续费及佣金支出的扣除标准
  • 接受捐赠会计准则
  • 汇兑结算计入什么会计科目
  • 一次性劳务报酬所得如何扣税
  • php实现留言板功能
  • 动力和燃料的区别
  • 运输费属于燃料费用吗
  • consul框架
  • ccf noi指导教师认证考核
  • php单例模式连接数据库
  • php实现自动识别的方法
  • 【Pytorch深度学习50篇】·······第六篇:【常见损失函数篇】-----BCELoss及其变种
  • 发票作废申请书模板
  • 报销差旅费属于什么现金流量项目
  • 临时工工资会计科目怎么录
  • 运输公司税务筹划
  • 可转债可以不卖吗
  • 价外费用企业所得税
  • 应收款和实收款区别
  • 新成立的小规模纳税人什么时候报税
  • 减免增值税后附加怎么算
  • 应收款项减值的备抵法及其会计处理
  • 不是公司的车费用能走公司吗
  • 借长期借款贷在建工程
  • 报销管理规定
  • 收入纳税明细里的收入和实际不符
  • 过路费抵扣进项税
  • 生产型企业成品入库会计分录
  • 税收会计采用什么记账法
  • mysql事件调用存储过程
  • session入库有什么好处
  • 如何恢复数据库删除的文件
  • win8系统怎样查看本机的ip地址
  • windows u盘不识别
  • win8系统设置
  • windows 10预览版
  • win10桌面右边没有了怎么弄出来了?
  • win7系统如何查看文件扩展名
  • windows8关机键在哪里
  • win7系统误删文件可以恢复吗
  • android ui绘制
  • JS写XSS cookie stealer来窃取密码的步骤详解
  • 贴吧热门评论
  • js定义数字
  • jquery仿淘宝商品详情页
  • git pull could not read from remote repository
  • unity 动态壁纸
  • linearlayout布局怎么设置
  • unity游戏开发的技术
  • android中常用的adapter不包括
  • python数据类型总结
  • 税务工作创新
  • 深圳市国税局副局长是谁
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设