Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H5编译的时候:Cannot find module "fs"。 #569

Open
haoranya opened this issue Jun 28, 2021 · 1 comment
Open

H5编译的时候:Cannot find module "fs"。 #569

haoranya opened this issue Jun 28, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@haoranya
Copy link

haoranya commented Jun 28, 2021

bug描述
项目初始化后,引入使用node的require('fs')模块会直接报错,找不到fs
复现bug的步骤

  1. cml init project
  2. cd test
  3. cml dev
  4. index.cml 的script中添加:const fs = require('fs')

问题截图
image

编译环境信息

  • chameleon-tool 版本:1.0.8
  • nodejs版本 npm版本:[node v10.13.0、npm 6.4.1]
  • 电脑操作系统: macOS Big Sur 11.0.1

运行环境信息

  • 端版本:PC Chrome浏览器 91.0.4472.114
  • 手机机型:
@haoranya haoranya added the bug Something isn't working label Jun 28, 2021
@duanlikang
Copy link

fs是Node专用的内部库,cml打包的时候,只会去 node_module递归查找对应库,fs是无法找到的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants