Giter Site home page Giter Site logo

compare-fixture's People

Contributors

mansona avatar

Stargazers

 avatar

Watchers

 avatar

compare-fixture's Issues

Running command not working

Things I've tried

Running with npx

npx compare-fixture pkg-pika pkg

Output: (Node v16.20.0 or Node v14.21.3)

npx: installed 12 in 1.304s
/Users/XXX/.npm/_npx/34130/bin/compare-fixture: line 1: import: command not found
/Users/XXX/.npm/_npx/34130/bin/compare-fixture: line 3: const: command not found
/Users/XXX/.npm/_npx/34130/bin/compare-fixture: line 4: const: command not found
/Users/XXX/.npm/_npx/34130/bin/compare-fixture: line 6: try{: command not found
/Users/XXX/.npm/_npx/34130/bin/compare-fixture: line 7: syntax error near unexpected token `fixtureDir,'
/Users/XXX/.npm/_npx/34130/bin/compare-fixture: line 7: `  compareFixture(fixtureDir, comparisonDir);'

Output: (Node v18.15.0)

npx: installed 12 in 2.79s
Command failed: compare-fixture spawn Unknown system error -8

Cloning the project and running it

node cli.js ../octokit/webhooks.js/pkg-pika ../octokit/webhooks.js/pkg

Output:

internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/XXX/dev/open_source/compare-fixture/' is not supported resolving ES modules imported from /Users/XXX/dev/open_source/compare-fixture/cli.js
Did you mean to import ../index.js?
    at new NodeError (internal/errors.js:322:7)
    at finalizeResolution (internal/modules/esm/resolve.js:314:17)
    at moduleResolve (internal/modules/esm/resolve.js:776:10)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:887:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
    at link (internal/modules/esm/module_job.js:75:36) {
  code: 'ERR_UNSUPPORTED_DIR_IMPORT',
  url: 'file:///Users/XXX/dev/open_source/compare-fixture/'
}

Possible solution:

Doing this change fixes the issue for me:

- import compareFixture from ".";
+ import compareFixture from "./index.js";

I'm happy to help on this and am open to submitting a PR.

When a file is present in one of the folders but not present on the other, it triggers an Error

Example:
types.js is present in one folder but not on the other.

ls ../octokit/webhooks.js/pkg-pika/dist-src ../octokit/webhooks.js/pkg/dist-src --no-user

image

Error Output

Error: ENOENT: no such file or directory, open '../octokit/webhooks.js/pkg/dist-src/middleware/node/types.js'
    at Object.openSync (node:fs:590:3)
    at readFileSync (node:fs:458:35)
    at file:///Users/XXX/dev/open_source/compare-fixture/index.js:21:25
    at Array.forEach (<anonymous>)
    at compareFixture (file:///Users/XXX/dev/open_source/compare-fixture/index.js:20:16)
    at file:///Users/XXXX/dev/open_source/compare-fixture/cli.js:7:3
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async loadESM (node:internal/process/esm_loader:91:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '../octokit/webhooks.js/pkg/dist-src/middleware/node/types.js'
}

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.