aerogear / create-graphql

Command-line utility to build production-ready servers with GraphQL.
MIT License
440 stars 38 forks source link

permit local installations #86

Open phra opened 7 years ago

phra commented 7 years ago

hi,

i'm trying to locally install create-graphql via yarn but i receive this error:

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "generator-graphql"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

it would be nice to avoid every reference to global packages in order to install create-graphql globally o locally.

sibelius commented 7 years ago

could you tried to use NVM or something like it? it makes installing global packages without need for root access

phra commented 7 years ago

you just have to use the existing dependencies system of npm modules instead of running arbitrary commands on the host machine to install required deps. please move generator-graphql as dep or peerDep and fix this.

lucasbento commented 7 years ago

@phra: our current structure runs this way because we have a CLI tool that abstracts the use of Yeoman.

We are going to improve that on our next major version that is focused on supporting plugins and parsing ASTs the same way that Babel does.