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

package.json not found #28

Open
AvidDabbler opened this issue Jul 18, 2024 · 1 comment
Open

package.json not found #28

AvidDabbler opened this issue Jul 18, 2024 · 1 comment

Comments

@AvidDabbler
Copy link

I have been struggling with gtfs-to-html and gtfs-to-geojson for a couple of days. After no success getting it working on my existing project and creating some new remix projects I was not able to get it to work.

Then this am i created a fresh bun project and I have found that the gtfs-to-geojson is causing an issue where it says that it cannot fine the package.json file.

You can take a look at the project here, then run pnpm gtfs

https://github.com/AvidDabbler/bun-gtfs

> gtfs-bun@ gtfs /Users/walter/Documents/transitchat/bun-gtfs
> bun gtfs/index.ts

484 | var stops_dissolved_default = stopsDissolved;
485 | 
486 | // src/lib/gtfs-to-geojson.ts
487 | var limit = pLimit(20);
488 | var { version } = JSON.parse(
489 |   readFileSync(new URL("../../package.json", import.meta.url).pathname, "utf8")
        ^
ENOENT: No such file or directory
   errno: -2
 syscall: "open"
   path: "/Users/walter/Documents/transitchat/bun-gtfs/node_modules/.pnpm/[email protected]/node_modules/package.json"

      at /Users/walter/Documents/transitchat/bun-gtfs/node_modules/.pnpm/[email protected]/node_modules/gtfs-to-geojson/dist/index.js:489:3

Bun v1.1.20 (macOS arm64)
@brendannee
Copy link
Member

Good catch - this has to do with how the path is different for the code in the /dist folder vs the /src.

I pushed an update https://github.com/BlinkTagInc/gtfs-to-geojson/releases/tag/3.7.5 which should solve this by changing how the version is loaded from package.json.

Let me know if that solves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants