空的示例项目构建发布失败

2022-5-13 11:26-debug: Start record console… {file(D:\cocosCreateSpace\NewProject\temp\builder\log\web-mobile2022-5-13 11-26.log)}
2022-5-13 11:26-debug: =================================== Build Task (web-mobile) Start ================================
2022-5-13 11:26-debug: Build with Cocos Creator: 3.2.1 (D:\cocosCreate\Creator\3.2.1\resources\app.asar)
2022-5-13 11:26-debug: Start build task, options:
{“name”:“NewProject”,“platform”:“web-mobile”,“buildPath”:“project://build”,“debug”:false,“md5Cache”:false,“sourceMaps”:false,“replaceSplashScreen”:false,“mainBundleCompressionType”:“merge_dep”,“mainBundleIsRemote”:false,“mergeStartScene”:false,“experimentalEraseModules”:false,“compressTexture”:true,“packAutoAtlas”:true,“startScene”:“7c3e7fab-7b1e-4865-ba84-3cf81b48b9fb”,“scenes”:[{“url”:“db://assets/scene/main.scene”,“uuid”:“7c3e7fab-7b1e-4865-ba84-3cf81b48b9fb”,“inBundle”:false}],“outputName”:“web-mobile”,“packages”:{“web-mobile”:{“orientation”:“auto”,“polyfills”:{“asyncFunctions”:true}},“cocos-service”:{“configID”:“bcf6d3”,“services”:[{“service_id”:“235”,“service_component_name”:“service-analytics”,“builder”:“C:\Users\Win10\.CocosCreator\.service\analytics\builder\builder.js”,“enable”:false,“params”:{}}]}}}
2022-5-13 11:26-debug: cocos-service:(onBeforeBuild) start…0%
2022-5-13 11:26-debug: // ---- cocos-service:(onBeforeBuild) ----
2022-5-13 11:26-debug: Process: heapTotal 181.68MB heapUsed 168.79MB rss 386.57MB
2022-5-13 11:26-debug: // ---- cocos-service:(onBeforeBuild) success ----
2022-5-13 11:26-debug: Query all assets info in project
2022-5-13 11:26-debug: cocos-service:(onBeforeBuild)3%
2022-5-13 11:26-debug: BuildAssetLibrary initialized with asset 324!
2022-5-13 11:26-debug: Number of all scenes: 1
2022-5-13 11:26-debug: Number of all scripts: 0
2022-5-13 11:26-debug: Number of other assets: 391
2022-5-13 11:26-debug: web-mobile:(onAfterInit) start…3%
2022-5-13 11:26-debug: // ---- web-mobile:(onAfterInit) ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 170.51MB rss 387.39MB
2022-5-13 11:26-debug: // ---- web-mobile:(onAfterInit) success ----
2022-5-13 11:26-debug: 加载刷新项目脚本 start5%
2022-5-13 11:26-debug: web-mobile:(onAfterInit)5%
2022-5-13 11:26-debug: reload all scripts.
2022-5-13 11:26-log: // ---- 加载刷新项目脚本 ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 170.55MB rss 387.39MB
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/base” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/gfx-webgl” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/gfx-webgl2” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/3d” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/2d” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/ui” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/particle-2d” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/particle” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/physics-2d-framework” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/physics-framework” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/intersection-2d” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/profiler” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/primitive” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/audio” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/terrain” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/video” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/webview” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/tween” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/spine” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/dragon-bones” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “pack:///mods/cce/internal/x/cc.js” loaded.
2022-5-13 11:26-debug: Invalidating ‘pack:///mods/cce/internal/x/cc.js’
2022-5-13 11:26-debug: [[Executor]] Module “cce:/internal/x/cc-fu/tiled-map” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “pack:///mods/cce/internal/x/prerequisite-imports.js” loaded.
2022-5-13 11:26-debug: [[Executor]] Module “pack:///mods/cce/internal/x/prerequisite-imports.js” loaded.
2022-5-13 11:26-debug: 加载刷新项目脚本 √8%
2022-5-13 11:26-debug: 查询 asset bundle start8%
2022-5-13 11:26-log: // ---- 查询 asset bundle ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 171.46MB rss 387.80MB
2022-5-13 11:26-debug: 查询 asset bundle √11%
2022-5-13 11:26-debug: 查询使用的资源以及资源包配置 start11%
2022-5-13 11:26-log: // ---- 查询使用的资源以及资源包配置 ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 171.52MB rss 387.87MB
2022-5-13 11:26-debug: Number of scenes: 1
2022-5-13 11:26-debug: Number of assets: 55
2022-5-13 11:26-debug: Number of asset bundle: 1
2022-5-13 11:26-debug: 查询使用的资源以及资源包配置 √14%
2022-5-13 11:26-debug: sort script group…
2022-5-13 11:26-debug: 整理脚本分组与脚本数据 start14%
2022-5-13 11:26-log: // ---- 整理脚本分组与脚本数据 ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 172.01MB rss 387.91MB
2022-5-13 11:26-debug: 整理脚本分组与脚本数据 √16%
2022-5-13 11:26-debug: 整理纹理压缩任务 start16%
2022-5-13 11:26-log: // ---- 整理纹理压缩任务 ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 172.04MB rss 387.91MB
2022-5-13 11:26-debug: Number of image-compress task: 0
2022-5-13 11:26-debug: 整理纹理压缩任务 √19%
2022-5-13 11:26-debug: 初步划分 json 合并分组 start19%
2022-5-13 11:26-log: // ---- 初步划分 json 合并分组 ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 172.12MB rss 388.10MB
2022-5-13 11:26-debug: Number of json group: 1
2022-5-13 11:26-debug: 初步划分 json 合并分组 √22%
2022-5-13 11:26-debug: 整理合并压缩 Texture2D 的 json 数据 start22%
2022-5-13 11:26-log: // ---- 整理合并压缩 Texture2D 的 json 数据 ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 172.19MB rss 388.10MB
2022-5-13 11:26-debug: 整理合并压缩 Texture2D 的 json 数据 √25%
2022-5-13 11:26-debug: start25%
2022-5-13 11:26-log: // ---- ----
2022-5-13 11:26-debug: Process: heapTotal 182.63MB heapUsed 172.22MB rss 388.10MB
2022-5-13 11:26-warn: Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

2022-5-13 11:26-warn: Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating

2022-5-13 11:26-debug: 打包脚本25%
2022-5-13 11:26-debug: Process: heapTotal 195.44MB heapUsed 182.35MB rss 399.13MB
2022-5-13 11:26-debug: 打包脚本√25%
2022-5-13 11:26-debug: 构建引擎25%
2022-5-13 11:26-debug: Copy externalScripts success!
2022-5-13 11:26-debug: Process: heapTotal 198.69MB heapUsed 183.41MB rss 401.71MB
2022-5-13 11:26-debug: Use cache engine: {link(C:\Users\Win10\AppData\Local\Temp\CocosCreator\3.2.1\builder\engine\da8d9aee95166db52907bd44579e43e1)}
2022-5-13 11:26-debug: {“debug”:false,“sourceMaps”:false,“includeModules”:[“base”,“gfx-webgl”,“gfx-webgl2”,“3d”,“2d”,“ui”,“particle”,“physics-ammo”,“physics-2d-box2d”,“intersection-2d”,“primitive”,“profiler”,“particle-2d”,“audio”,“video”,“webview”,“tween”,“terrain”,“tiled-map”,“spine”,“dragon-bones”],“engineVersion”:“3.2.1”,“platform”:“HTML5”,“md5Map”:[],“engineName”:“cocos-js”,“useCache”:true,“split”:false,“ammoJsWasm”:“fallback”,“assetURLFormat”:“runtime-resolved”,“entry”:“D:\cocosCreate\Creator\3.2.1\resources\resources\3d\engine”}
2022-5-13 11:26-error: {“errno”:-4068,“code”:“EISDIR”,“syscall”:“readlink”,“path”:“D:\cocosCreateSpace\NewProject\build\web-mobile\cocos-js”}
2022-5-13 11:26-debug: EISDIR: illegal operation on a directory, readlink 'D:\cocosCreateSpace\NewProject\build\web-mobile\cocos-js’25%
2022-5-13 11:26-error: {“errno”:-4068,“code”:“EISDIR”,“syscall”:“readlink”,“path”:“D:\cocosCreateSpace\NewProject\build\web-mobile\cocos-js”}
2022-5-13 11:26-debug: ================================ Build Task (web-mobile) Finished ================================

没有哎 我就是把环境装好 然后测试打包就不行了 项目什么都没有弄 尝试了很多办法

这个与npm或者是nodejs有关系吗? 我在网上搜索到这个问题可能与npm有关系?

这个我不太确定,编辑器组的同事在帮忙看这个问题了。

谢谢你们 :blush:

有尝试过换个安装路径吗?不放在 C 盘的那种,报错的目录 web-mobile\cocos-js 能否被正常删除?

image
安装路径一直都在d盘 然后每次打包出来之后 文件夹下面没有文件

这里是引擎文件,引擎缓存目录在这个位置:C:\Users\Win10\AppData\Local\Temp\CocosCreator\3.2.1\builder\engine\da8d9aee95166db52907bd44579e43e1 这个位置有文件吗?

我也遇到了这个问题

C:\Users\Win10\AppData\Local\Temp\CocosCreator\3.2.1\builder\engine\da8d9aee95166db52907bd44579e43e1 这个文件是存在的

有这个文件的~

截图只有文件夹,文件夹里面有文件内容截图一下?清理全局构建缓存后重新构建可以正常?


一直都没有成功过 全新的项目 是否与node版本有关系呢?

有使用最新版本试过吗?3.2.1 版本比较旧了,之前版本的日志信息里调用栈信息不完整,看的到错误但是看不到调用栈还是不知道哪里报错的。或者你截图一下在构建调试工具里的错误调用栈信息?


错误展开的是啥?要看调用栈

试过这些方式吗?

有大致定位两处可能在不同运行环境有差异的代码,可以帮忙试下吗?在控制台里执行

  1. require('fs-extra').emptyDir(require('path').join(Editor.Project.path, 'build-engine-test1'));
  2. require('fs-extra').copy('C:\\Users\\Win10\\AppData\\Local\\Temp\\CocosCreator\\3.2.1\\builder\\engine\\da8d9aee95166db52907bd44579e43e1', require('path').join(Editor.Project.path, 'build-engine-test2'), { recursive: true, })

,如果报一样的错误的话,那我们这边就可以确认原因了,会马上加到最新的 3.5.1.


构建调试工具里面执行? 控制台没法输入啊~ 我不太懂 新手= = !!