Code Monkey home page Code Monkey logo

Comments (16)

lucasbento avatar lucasbento commented on August 23, 2024

Hmm, how did you install create-graphql on the first place? Using yarn or npm?

Can you check if yo (yeoman) is installed on your machine?

from create-graphql.

katopz avatar katopz commented on August 23, 2024

Oh! it work after I manually npm install -g yo (I use npm way)
At first I think ✓ Yeoman installed! should install yeoman for me already like it said. 🤕

from create-graphql.

lucasbento avatar lucasbento commented on August 23, 2024

That's what it is supposed to do, it actually just trigger a npm install -g yo while you are trying to generate a file.

Do you have yarn installed? If you do, what version is it?

from create-graphql.

katopz avatar katopz commented on August 23, 2024

Somehow yes but I rarely use it, it's 0.17.10

from create-graphql.

felippepuhle avatar felippepuhle commented on August 23, 2024

Maybe the path variable isn't being updated?

from create-graphql.

lucasbento avatar lucasbento commented on August 23, 2024

The problem is probably with yarn itself, since it is already on version 0.19.1.

create-graphql checks if you have yarn installed, if you do, it uses it, otherwise it goes with npm.

Perhaps it's better to remove that checking for now and go with npm only, what do you guys think?

from create-graphql.

katopz avatar katopz commented on August 23, 2024

I think I mess thing up already when try to uninstall yarn

cat:mongoose-role-example katopz$ yarn --version
0.17.10
cat:mongoose-role-example katopz$ npm r -g yo
- [email protected] node_modules/yo/node_modules/abbrev
...
- [email protected] node_modules/yo
cat:mongoose-role-example katopz$ create-graphql generate --type Awesome
✗ GraphQL CLI requires Yeoman to be installed.
✓ Yeoman installed!
/bin/sh: yo: command not found
(node:9879) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with status 127
(node:9879) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cat:mongoose-role-example katopz$ brew uninstall yarn
Uninstalling /usr/local/Cellar/yarn/0.17.10... (5,638 files, 18.2M)
cat:mongoose-role-example katopz$ yarn --version
-bash: /usr/local/bin/yarn: No such file or directory
cat:mongoose-role-example katopz$ create-graphql generate --type Awesome
✗ GraphQL CLI requires Yeoman to be installed.
✗ There was an error while trying to install Yeoman: { Error: Exited with status 127
    at closeArgsToError (/usr/local/lib/node_modules/create-graphql/node_modules/cross-spawn-promise/lib/index.js:20:16)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/create-graphql/node_modules/cross-spawn-promise/lib/index.js:76:19)
    at Object.onceWrapper (events.js:290:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
  exitStatus: 127,
  stdout: null,
  stderr: <Buffer 2f 62 69 6e 2f 73 68 3a 20 79 61 72 6e 3a 20 63 6f 6d 6d 61 6e 64 20 6e 6f 74 20 66 6f 75 6e 64 0a> }
/bin/sh: yo: command not found
(node:10109) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with status 127
(node:10109) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cat:mongoose-role-example katopz$ npm install --global create-graphql
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
/usr/local/bin/create-graphql -> /usr/local/lib/node_modules/create-graphql/bin/create-graphql

> [email protected] postinstall /usr/local/lib/node_modules/create-graphql
> npm i -g generator-graphql

/usr/local/lib
└── [email protected] 

/usr/local/lib
└── [email protected] 
cat:mongoose-role-example katopz$ create-graphql generate --type Awesome
✗ GraphQL CLI requires Yeoman to be installed.
✗ There was an error while trying to install Yeoman: { Error: Exited with status 127
    at closeArgsToError (/usr/local/lib/node_modules/create-graphql/node_modules/cross-spawn-promise/lib/index.js:20:16)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/create-graphql/node_modules/cross-spawn-promise/lib/index.js:76:19)
    at Object.onceWrapper (events.js:290:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
  exitStatus: 127,
  stdout: null,
  stderr: <Buffer 2f 62 69 6e 2f 73 68 3a 20 79 61 72 6e 3a 20 63 6f 6d 6d 61 6e 64 20 6e 6f 74 20 66 6f 75 6e 64 0a> }
/bin/sh: yo: command not found
(node:10190) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with status 127
(node:10190) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Sorry! 😭

from create-graphql.

sibelius avatar sibelius commented on August 23, 2024

@katopz I recommend u to use NVM to manage your node versions, it can solve your problem

from create-graphql.

lucasbento avatar lucasbento commented on August 23, 2024

@katopz: it's weird, you uninstalled yarn but it's still on your path.

Can you try hitting which yarn on command-line?

I think we can remove that yarn/npm checking, a lot of users are having problem with yarn :/

from create-graphql.

felippepuhle avatar felippepuhle commented on August 23, 2024

I can work on it, if you guys want...

from create-graphql.

lucasbento avatar lucasbento commented on August 23, 2024

I think it's the best we can do right now, yarn itself is not stable yet and a lot of people are using old versions.

To remove the yarn checking, simply change this part, @felippepuhle, and then we can make a release for it.

from create-graphql.

sibelius avatar sibelius commented on August 23, 2024

can't we try to install yeoman using yarn and check if yeoman was installed successful, if not we install using npm

from create-graphql.

lucasbento avatar lucasbento commented on August 23, 2024

@sibelius: that sounds like an ugly workaround, I wouldn't like that any tool did so.

from create-graphql.

lucasbento avatar lucasbento commented on August 23, 2024

@katopz: we just released 1.1.16 with @felippepuhle's #76 PR, would you mind checking if it works for you?

from create-graphql.

katopz avatar katopz commented on August 23, 2024

@lucasbento LGTM no more error with or without yarn

$ create-graphql generate --type Awesome
✗ GraphQL CLI requires Yeoman to be installed.
✓ Yeoman installed!
identical src/type/__tests__/AwesomeType.spec.js
identical src/type/AwesomeType.js
🔥 Type created!

$ which yarn
/usr/local/bin/yarn

$ brew uninstall yarn
Uninstalling /usr/local/Cellar/yarn/0.20.3... (4,740 files, 17.6M)

$ which yarn

$ create-graphql generate --type Awesome
identical src/type/__tests__/AwesomeType.spec.js
identical src/type/AwesomeType.js
🔥 Type created!

BTW, I think I've 2 yarn, one from brew and one from npm Sorry for the mess!

Thanks

from create-graphql.

lucasbento avatar lucasbento commented on August 23, 2024

Yeah, we removed yarn for now, it's not stable yet and not a lot of people have it working.

Don't hesitate on opening a new issue if you need, @katopz.

from create-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.