你想在 Creator 中使用哪些 npm 包?

咋么引用??

lzma这个包能支持吗,还有请问有对进行解密的ase库目前creator有没有支持的,我们现在需要一个解密库和一个解压缩库,加密解密压缩这些应该是游戏常用的吧?请问能支持吗

一年多了了,都3.7.2了 buff还是不能直接npm…打包报’Buffer’ is not exported by

tsrpc https://tsrpc.cn/

3.5.2 使用pako,https://cocos.github.io/packages/pako
引入pako 提示,找不到这个模块、还需要配置吗?但是包是安装成功的啊

已解决、是我本地的npm版本没有升级、没有成功安装到pako

import buffer from 'buffer';
console.log(new buffer.Buffer(2));

@shrinktofit,您好。请问 npm install firebase 后导包并使用:

import { getAnalytics } from "firebase/analytics";
const analytics = getAnalytics();

导致编辑器中报错: [Scene] Error: Error: Unexpected export statement in CJS module.
应该怎么解决

Cocos 3.7.3

你好,请问问题解决了吗? 我也遇到了这个问题

你好:

  1. 关掉Cocos creator,删除library跟temp
  2. 往node_modules/@firebase/每个子文件夹里的 package.json 里加入 “type”: “module”

我用的3.6.x和3.8都试过了,这个方法也不好使啊

求助,Buffer一直报错,导入node包也不好使,网上找了许多办法都不好用,一运行就报错找不到Buffer,附件demo已上传,希望能帮忙看看testbuff.rar (3.9 MB)

求助:帮忙在https://cocos.github.io/cocos-can-i-use-npm/加入moment可以吗?
官网:https://momentjs.com/timezone/
非常需要,项目长期使用!

momentjs已经废弃了,建议用dayjs,可以一比一替换

rapier2d 可以吗
https://rapier.rs/docs/user_guides/javascript/getting_started_js

npm下载firebase 怎么使用 Error: Error: Unexpected export statement in CJS module. 3.7.3版本

上述操作方法无效啊 :sob:

确实无效3.6.3

import dayjs from ‘dayjs’;

import timezone from ‘dayjs/plugin/timezone.js’;

import utc from ‘dayjs/plugin/utc.js’;

dayjs.extend(utc);

dayjs.extend(timezone);
这样可以解决,我用的3.x

1赞

如果能用zlib的话,我会很开心,毕竟现在用的都是直接找的老的集成库