cocos / cocos/cocos-cli

ubantu 24.04 编译项目报错,cli不支持linux系统?

Open
#384 6 comments 1 reaction 1 assignee View on GitHub

@star-e is already working on this.

Since Jan 12, 2026.

P2
Dominant language
TypeScript
Stars
430
Forks
154
Avg merge
2d 4h
Merged PRs (30d)
61

Description

在ubantu下面cli工程npm i安装完成后,执行npm link,然后修改./dist/cli.js的权限后。
cocos create -j test可以正常创建
但是cocos build -j test-pink -p web-mobile报错,mac OS可以正常打包
基本是以下错误:
ERROR TypeError: Cannot read properties of null (reading 'getSupportedExtensions')
at /root/cocos-cli/src/core/assets/effect-compiler/shdc-lib.js:1217:36
at Object. (/root/cocos-cli/src/core/assets/effect-compiler/shdc-lib.js:1278:3)
at Module._compile (node:internal/modules/cjs/loader:1730:14)
at Object..js (node:internal/modules/cjs/loader:1895:10)
at Module.load (node:internal/modules/cjs/loader:1465:32)
at Function. (node:internal/modules/cjs/loader:1282:12)
at Function.ModuleInternal._load (/root/cocos-cli/packages/cc-module/src/loader.ts:62:35)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Module. (node:internal/modules/cjs/loader:1487:12)

ERROR register asset-handler effect failed!

错误2:
ERROR TypeError: Cannot read properties of undefined (reading '0')
at upgradeProperties (/root/cocos-cli/src/core/assets/asset-handler/assets/utils/material-upgrader.ts:111:37)
at Object.import (/root/cocos-cli/src/core/assets/asset-handler/assets/material.ts:62:44)
at CustomImporter.import (/root/cocos-cli/src/core/assets/manager/asset-handler.ts:47:43)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.