# Import module node-crc

**URL:** <https://discourse.nodered.org/t/import-module-node-crc/82493>\
**Category:** General\
**Created:** [31 October 2023 14:29 UTC](https://discourse.nodered.org/t/import-module-node-crc/82493 "2023-10-31T14:29:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sineos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sineos/32/3440_2.png) [@Sineos](https://discourse.nodered.org/u/Sineos)\
**Post date:** [31 October 2023 14:29 UTC](https://discourse.nodered.org/t/import-module-node-crc/82493/1 "2023-10-31T14:29:47Z")

</div>

Hi all,

I'm trying to use the module [node-crc](https://github.com/magiclen/node-crc) and while other imported modules work, I cannot get this one to work.

**1st attempt:**

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e79c04705e83954468280319d357e6f7190064ed.png)

called with:

```auto
const result = nodecrc.crc(...)

```

always ends up with:  
`TypeError: Cannot read properties of undefined (reading 'crc')`

**2nd attempt as `functionGlobalContext`:**

```auto
Error loading settings file: /home/vent/.node-red/settings.js
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/vent/.node-red/node_modules/node-crc/lib/lib.js from /home/vent/.node-red/settings.js not supported.
Instead change the require of lib.js in /home/vent/.node-red/settings.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/vent/.node-red/settings.js:432:17)
    at Object.<anonymous> (/usr/lib/node_modules/node-red/red.js:140:20) {
  code: 'ERR_REQUIRE_ESM'
}

```

Any pointer would be appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 December 2023 14:30 UTC](https://discourse.nodered.org/t/import-module-node-crc/82493/2 "2023-12-30T14:30:30Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
