create-graphql icon indicating copy to clipboard operation
create-graphql copied to clipboard

permit local installations

Open phra opened this issue 8 years ago • 3 comments

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.

phra avatar Apr 25 '17 08:04 phra

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

sibelius avatar Apr 26 '17 00:04 sibelius

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.

phra avatar Apr 26 '17 12:04 phra

@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.

lucasbento avatar Apr 26 '17 12:04 lucasbento