Git Product home page Git Product logo

Comments (4)

ninoseki avatar ninoseki commented on August 26, 2024

@xme Hi, it's very strange to me.
In CI(GitHub Actions). this package is tested with the following combinations and there is no such issue.

  • Node.js v16 + npm v7
  • Node.js v14 + npm v6

(https://github.com/ninoseki/ioc-extractor/blob/master/.github/workflows/test.yml#L10-L24)

Also, I'm using this package with Node.js v14 + npm v7 in my laptop.

Thus I guess you are using very old Node.js + npm. If so could you update Node.js and npm, please?

from ioc-extractor.

xme avatar xme commented on August 26, 2024

I also tested with the official node Docker image…

root@e7a8590c4a7e:/# ioc-extractor 
node:internal/modules/cjs/loader:1126
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /usr/local/lib/node_modules/ioc-extractor/node_modules/get-stdin/index.js
require() of ES modules is not supported.
require() of /usr/local/lib/node_modules/ioc-extractor/node_modules/get-stdin/index.js from /usr/local/lib/node_modules/ioc-extractor/dist/bin/ioc-extractor.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /usr/local/lib/node_modules/ioc-extractor/node_modules/get-stdin/package.json.

    at new NodeError (node:internal/errors:363:5)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1126:13)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ioc-extractor/dist/bin/ioc-extractor.js:14:21)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32) {
  code: 'ERR_REQUIRE_ESM'
}
root@e7a8590c4a7e:/# npm -v
7.15.1
root@e7a8590c4a7e:/# nodejs -v
v16.3.0
root@e7a8590c4a7e:/#

from ioc-extractor.

ninoseki avatar ninoseki commented on August 26, 2024

@xme Hi, sorry it's my bad.
I just fixed the issue in the latest version. Could you update the package and try it again, please?

from ioc-extractor.

xme avatar xme commented on August 26, 2024

Confirmed working now, tx for your help!

from ioc-extractor.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.