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

[Bug]: failing to read package.json (at wrong directory) #1746

Closed
1 task done
jaril opened this issue Jul 18, 2023 · 6 comments
Closed
1 task done

[Bug]: failing to read package.json (at wrong directory) #1746

jaril opened this issue Jul 18, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@jaril
Copy link

jaril commented Jul 18, 2023

What happened?

Tried to run tldraw locally following the README instructions (yarn, yarn dev).

The yarn dev step throws an error where it seems to try to read package.json from my root directory instead of the tldraw folder.

➜  tldraw git:(main) pwd
/Users/jarilvalenciano/ws/tldraw
➜  tldraw git:(main) yarn; yarn dev;
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @auto-it/core@npm:10.45.0 [37d36] doesn't provide @types/node (pfbc52), requested by ts-node
➤ YN0002: │ @auto-it/npm@npm:10.46.0 doesn't provide typescript (p064ed), requested by @auto-it/core
➤ YN0002: │ @auto-it/released@npm:10.46.0 doesn't provide typescript (p04900), requested by @auto-it/core
➤ YN0002: │ @auto-it/version-file@npm:10.46.0 doesn't provide typescript (p60e3b), requested by @auto-it/core
➤ YN0002: │ @endemolshinegroup/cosmiconfig-typescript-loader@npm:3.0.2 [1083e] doesn't provide typescript (p8ded4), requested by ts-node
➤ YN0002: │ @tldraw/assets@workspace:packages/assets doesn't provide typescript (p8f881), requested by ts-node-dev
➤ YN0002: │ @tldraw/store@workspace:packages/store doesn't provide react (pb1409), requested by @tldraw/state
➤ YN0002: │ @tldraw/tlschema@workspace:packages/tlschema doesn't provide react (p38abe), requested by @tldraw/state
➤ YN0002: │ auto@npm:10.46.0 doesn't provide typescript (p78071), requested by @auto-it/core
➤ YN0002: │ config@workspace:config doesn't provide eslint (pee0a8), requested by eslint-config-prettier
➤ YN0002: │ config@workspace:config doesn't provide eslint (p7d3d5), requested by eslint-plugin-react
➤ YN0002: │ examples.tldraw.com@workspace:apps/examples doesn't provide @babel/core (p3c91a), requested by @babel/plugin-proposal-decorators
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide eslint (p8dae3), requested by @typescript-eslint/eslint-plugin
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide eslint (p6ef29), requested by @typescript-eslint/parser
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide react (p30fd0), requested by @tldraw/editor
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide react (pab13c), requested by @tldraw/tldraw
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide react-dom (p68b55), requested by @tldraw/editor
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide react-dom (p7b53d), requested by @tldraw/tldraw
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide typescript (pb7509), requested by ts-loader
➤ YN0002: │ tldraw-vscode@workspace:apps/vscode/extension doesn't provide webpack (p07c3d), requested by ts-loader
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 298ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 261ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @tldraw/monorepo@workspace:. must be built because it never has been before or the last one failed
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT husky - Git hooks installed
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT lazyrepo 0.0.0-alpha.27
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT -----------------------
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT ∙ ERROR ∙ Failed reading package.json in '/Users/jarilvalenciano'
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT Required at "name"
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT Required at "version"
➤ YN0009: │ @tldraw/monorepo@workspace:. couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/01/1smzd4054cx_99zjg_qmpj5h0000gn/T/xfs-cd821360/build.log)
➤ YN0000: └ Completed in 1s 321ms
➤ YN0000: Failed with errors in 2s 49ms
lazyrepo 0.0.0-alpha.27
-----------------------
∙ ERROR ∙ Failed reading package.json in '/Users/jarilvalenciano'
Required at "name"
Required at "version"

How can we reproduce the bug?

The error persist even after running the command multiple times.

Other info that may be useful:

  • OS: macOS 13.3.1 (a) (22E772610a)
  • node: v18.13.0
  • npm: 8.19.3
  • yarn: 3.5.0

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

Contact Details

jarilvalenciano@gmail.com

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jaril jaril added the bug Something isn't working label Jul 18, 2023
@steveruizok steveruizok changed the title [Bug]: [Bug]: failing to read package.json (at wrong directory) Jul 18, 2023
@adi-lb-phoenix
Copy link

adi-lb-phoenix commented Aug 3, 2023

did you run "yarn add @tldraw/tldraw@alpha" from the root directory , that is tldraw/ ?

@chadbailey59
Copy link

I'm having the same problem. MacOS Ventura 13.4 (M1 ARM Mac), node 18.16.1, yarn 3.5.0, npm 9.5.1.

@jiannystein
Copy link

➤ YN0000: ┌ Link step
➤ YN0007: │ core-js@npm:3.32.2 must be built because it never has been before or the last one failed
➤ YN0007: │ @tldraw/monorepo@workspace:. must be built because it never has been before or the last one failed
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT husky - Git hooks installed
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT lazyrepo 0.0.0-alpha.27
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT -----------------------
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT ∙ ERROR ∙ Failed reading package.json in '/root'
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT Required at "name"
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT Required at "version"
➤ YN0009: │ @tldraw/monorepo@workspace:. couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-88627b65/build.log)
➤ YN0000: └ Completed in 6s 840ms
➤ YN0000: Failed with errors in 20s 497ms
root@testprojects:~/tldraw# node -v
v18.13.0
root@testprojects:~/tldraw# npm -v
9.2.0
root@testprojects:~/tldraw# yarn -v
3.5.0```

@ttlpta
Copy link

ttlpta commented Sep 29, 2023

➤ YN0000: ┌ Link step
➤ YN0007: │ @tldraw/monorepo@workspace:. must be built because it never has been before or the last one failed
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT husky - Git hooks installed
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT lazyrepo 0.0.0-alpha.27
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT -----------------------
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT ∙ ERROR ∙ Failed reading package.json in '/home/anh.pham9/Projects'
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT Required at "name"
➤ YN0000: │ @tldraw/monorepo@workspace:. STDOUT Required at "version"
➤ YN0009: │ @tldraw/monorepo@workspace:. couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-7797dd31/build.log)
➤ YN0000: └ Completed in 1s 796ms
➤ YN0000: Failed with errors in 27s 116ms

I met this error too on linux (Ubuntu 22)

@ttlpta
Copy link

ttlpta commented Sep 29, 2023

image
Finally , I yarned success, i think the reason for this issue is on the parent directory (folder "Projects" in my local) has yarn.lock, package json, .yarn.. I removed all of them, and run yarn success.

@MitjaBezensek
Copy link
Contributor

Yeah, lazyrepo continues going up the folders to find the root folder. If you have some package.json files above the root tldraw folder this can happen.

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

6 participants