atom-react-autocomplete icon indicating copy to clipboard operation
atom-react-autocomplete copied to clipboard

Error on generate

Open joepio opened this issue 7 years ago • 2 comments

EDIT: Repeated the same steps, but the problem is no longer there. I have no idea as to why, though.

I followed the steps of the readme, but I can't get the rc-autocomplete generate command to work. Running it results in:

React Doc Gen Finished. Build Tokens
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);^

Error: ENOENT: no such file or directory, open '/Users/joep/Dev/my_project/node_modules/react-autocomplete-cli/react-doc-gen-output.js
on'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at generateCompletions (/Users/joep/Dev/my_project/node_modules/react-autocomplete-cli/parse-docgen.js:14:33)
    at /Users/joep/Dev/my_project/node_modules/react-autocomplete-cli/generate-completions.js:31:3

    at ChildProcess.exithandler (child_process.js:209:5)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "rc-autocomplete"
npm ERR! node v5.10.1
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] rc-autocomplete: `rc-autocomplete`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] rc-autocomplete script 'rc-autocomplete'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rc-autocomplete

My importjs.json:

{ "lookupPaths": [ "node_modules/**/*.js", "app/components" ] }

I'm running Atom 1.10.2 on MacOS 10.12.1 (Beta).

Perhaps I'm doing something wrong, or some library in my project is not fully compatible.

Thanks for the hard work, by the way! This is exactly the tool that I wanted :)

joepio avatar Oct 04 '16 11:10 joepio

Same happend to me (windows os)

SanthoshDhandapani avatar Mar 27 '17 07:03 SanthoshDhandapani

Alright if anyone still wants this info, I've been looking at his code and seeing what could go wrong. Some things are, he doesn't tell us that our component definitions have to follow the guidelines listed on this page: https://github.com/reactjs/react-docgen , because that's the tool he uses to analyze it. Something else I found is that even though it doesn't tell you anywhere, each .jsx file you use has to have only one component being exported in it... you can't have multiple. And the path name has to include the .jsx in it. Or if its a folder, the only files in it can be js/x files with only one component exported in each one. IF any of this doesn't help, what you can do is go to the node_modules/react-autocomplete-cli/ package, and change the bottom exec statement and change it to

exec(`${docGenPath} ${componentsPath} -o ${tmpOutput}`, {cwd: cwd}, function (error, stdout, stderr) { console.log('React Doc Gen Finished. Build Tokens') console.log("\n\n\n") console.log("ERROR") console.log(error) console.log("\n\n\n") console.log("STDOUT") console.log(stdout) console.log("\n\n\n") console.log("STDERR") console.log(stderr) console.log("\n\n\n") generateCompletions() })

And this will output a more specific error as to what's going wrong. If there is any sort of error happening, it WON'T generate the react-doc-gen-output.js file that you're getting the error from.

Hope this helps!

jolaroux avatar May 22 '17 03:05 jolaroux