graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

`graph` command should work without `yarn install`

Open lutter opened this issue 2 years ago • 0 comments

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

I installed the graph command using the script from http://cli.thegraph.com/install.sh into ~/packages/graph. Using that without a package.json (or yarn install) leads to errors from graph build and graph deploy, either compiler errors or the error Error: could not locate node_modules in parent directories of subgraph manifest

Reproduction

https://github.com/graphprotocol/graph-node/tree/master/tests/integration-tests/int8

Steps to Reproduce the Bug or Issue

To reproduce this, copy this subgraph into a new directory (say /var/tmp/int8) and then

cd /var/tmp/int8
rm -rf test/ package.json tuffle.js
# We now have a very pristine subgraph

# This works
graph codegen
# This errors complaining about node_modules
graph build # errors complaining about node_modules
# Same here
graph deploy --node http://localhost:3032 --version-label v0.0.1 --ipfs http://localhost:3001 test/host-exports subgraph.yaml

Expected behavior

It would be great if just installing the graph command would let me build and deploy a subgraph; otherwise, there's little advantage to installing it that way over running yarn install and then yarn graph

Screenshots or Videos

No response

Platform

  • OS: Linux
  • NodeJS: v20.8.1
  • graph --version: @graphprotocol/graph-cli/0.60.0 linux-x64 node-v16.20.

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

lutter avatar Nov 08 '23 18:11 lutter