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

Error: yarn fails to install dependencies for Sub-Graph Studio #540

Closed
DorianDaSilva opened this issue Nov 10, 2022 · 3 comments
Closed

Comments

@DorianDaSilva
Copy link

DorianDaSilva commented Nov 10, 2022

Error: Command failed: yarn

================================================================================

image

================================================================================

I follow the steps below to set up a sub-graph in graph studio but install fails when yarn is installing dependencies.

1-yarn global add @graphprotocol/graph-cli

2-graph init --studio nft-marketplace - This is were the error is prompted on the final step (yarn dependencies)

I do see the files and folders in VsCode but due to error with yarn I assume install is incomplete (img below)
image

====================================================================================

Package.json

{
  "name": "nft-marketplace",
  "license": "UNLICENSED",
  "scripts": {
    "codegen": "graph codegen",
    "build": "graph build",
    "deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ nft-marketplace",
    "create-local": "graph create --node http://localhost:8020/ nft-marketplace",
    "remove-local": "graph remove --node http://localhost:8020/ nft-marketplace",
    "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 nft-marketplace",
    "test": "graph test"
  },
  "dependencies": {
    "@graphprotocol/graph-cli": "0.35.0",
    "@graphprotocol/graph-ts": "0.28.1"
  },
  "devDependencies": { "matchstick-as": "0.5.0" }
}

====================================================================================

Yarn-error.log

......

Yarn version: 
  1.22.19

Node version: 
  16.14.2

Platform: 
  linux x64

Trace: 
  SyntaxError: /home/<name>/.cache/yarn/v6/npm-binaryen-102.0.0-nightly.20211028-8f1efb0920afd34509e342e37f84313ec936afb2-integrity/node_modules/binaryen/.yarn-metadata.json: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at /home/<name>/.yarn/lib/cli.js:1629:59
      at Generator.next (<anonymous>)
      at step (/home/<name>/.yarn/lib/cli.js:310:30)
      at /home/<name>/.yarn/lib/cli.js:321:13

npm manifest: 
  {
    "name": "nft-marketplace",
    "license": "UNLICENSED",
    "scripts": {
      "codegen": "graph codegen",
      "build": "graph build",
      "deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ nft-marketplace",
      "create-local": "graph create --node http://localhost:8020/ nft-marketplace",
      "remove-local": "graph remove --node http://localhost:8020/ nft-marketplace",
      "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 nft-marketplace",
      "test": "graph test"
    },
    "dependencies": {
      "@graphprotocol/graph-cli": "0.35.0",
      "@graphprotocol/graph-ts": "0.28.1"
    },
    "devDependencies": { "matchstick-as": "0.5.0" }
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile

====================================================================================

Can you please help me figure out a way around this issue, please? Thank you!

@DorianDaSilva DorianDaSilva changed the title Error: yarn fails to instal dependencies for Sub-Graph Studio Error: yarn fails to install dependencies for Sub-Graph Studio Nov 10, 2022
@DorianDaSilva
Copy link
Author

Cloned the subgraph repo from the course GitHub and added missing dependencies manually one by one.

Still interested in knowing what the issue was with yarn during the install and if I am the only one that had the problem.

@fordN
Copy link
Contributor

fordN commented Nov 11, 2022

Hey @DorianDaSilva 👋

Were you able to get past this issue? It looks like yarn/npm had trouble parsing a JSON object when it was trying to build dependencies for you project, so likely there was a malformed or unsupported object in your package.json or in a file in one of the dependencies.

For the future please direct graph-cli issues to the the graph-cli repo or to the #subgraph-development channel in The Graph discord.

@fordN
Copy link
Contributor

fordN commented Nov 11, 2022

I'm going to close this issue here. If you would like to flag the issue to the graph-cli development team and continue to root cause I'd suggest making a new issue in the graph-cli repo.

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