After running npm install -g graphcool
, when i try to run gcf
, i get the following message:
! 'ENOENT': ENOENT: no such file or directory, lstat 'C:\Users\Administrador\.graphcool'
Get in touch if you need help: https://www.graph.cool/forum
To get more detailed output, run $ export DEBUG="*"
The previous version 0.10.1
seems to work ok.
got the same issue here with npm install -g graphcool AND npm install -g graphcool-framework
I get the same error on a Mac too.
â–¸ 'ENOENT': ENOENT: no such file or directory, lstat '/Users/melxx001/.graphcool'
Get in touch if you need help: https://www.graph.cool/forum
To get more detailed output, run $ export DEBUG="*"
workaround, create a folder it want $ mkdir ~/.graphcool
but some option from previous version will not work, such as --schema
or --name
:(
@ilumin can verify that's the workaround, did same to make the example projects work. Specifically created a ~/.graphcool/config.yml file.
$ mkdir ~/.graphcool
$ cd .graphcool
$ touch config.yml
can verify that this is not just on windows. what happened? :(
Confirm this happens on Mac as well, I did
npm install -g [email protected]
and then graphcool init
worked without this error.
Should be the same for graphcool-framework
Facing this issue on Ubuntu as well with the latest version.
I took a peek into source files, the error is happening inside graphcool-cli-engine
which isn't open sourced apparently. However, there is this piece of code in the installed module...
Environment.prototype.migrateGlobalFiles = function () {
var dotFilePath = path.join(this.config.home, '.graphcool');
var dotExists = fs_1.default.pathExistsSync(dotFilePath);
if (fs_1.default.lstatSync(dotFilePath).isDirectory()) {
return;
}
var rcHomePath = path.join(this.config.home, '.graphcoolrc');
var rcHomeExists = fs_1.default.pathExistsSync(rcHomePath);
var dotFile = dotExists ? fs_1.default.readFileSync(dotFilePath, 'utf-8') : null;
var rcFile = rcHomeExists ? fs_1.default.readFileSync(rcHomePath, 'utf-8') : null;
// if both legacy files exist, prefer the newer one, .graphcool
if (rcHomeExists && rcFile) {
// only move this file, if it is json and contains the "token" field
// in this case, it's the old format
....
}
I haven't used graphcool now for like 2 months, so I am not sure why all this shifting and what's actually happening. Apparently creating empty .graphcool
directory indeed is a valid workaround as it then returns on a first condition and nothing else is being done. I wasn't able to find when and how is this directory used.
Can everyone confirm that running $ mkdir ~/.graphcool
fixes this problem? @KevinAsher @ekrolewicz6 @melxx001 @sw-yx @jasonrhodes @MohammedSiddiqui10p
@ilumin:
but some option from previous version will not work, such as --schema or --name :(
This change was actually introduced a long time ago, with the introduction of graphcool.yml
where you now reference the datamodel schema.
@FredyC:
I haven't used graphcool now for like 2 months, so I am not sure why all this shifting and what's actually happening.
The binary name change is in anticipation of Graphcool 1.0, as mentioned in the release notes. You can find out more about the Graphcool 1.0 preview in the feedback thread in the Forum.
the error is happening inside graphcool-cli-engine which isn't open sourced apparently.
Ok, thanks. I made the fix ... #1459
Edit: Might be useful to add repo address to package.json so it's exposed on NPM. Otherwise it looks like closed source :)
@marktani confirmed. seems an unfortunate oversight but an easy fix.
@marktani also confirming. I tried the workaround suggested by @state0fmind and it ran perfectly afterwards
Thanks, @state0fmind @marktani
mkdir ~/.graphcool
solve the problem
Most helpful comment
I get the same error on a Mac too.