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

Windows 10 MongoDB Error 2

Open bfitzsimmons703 opened this issue 8 years ago • 11 comments

Hello! After installing CGS and all its dependencies on Windows 10, I immediately get "Error Code 2: MongoDB was started with erroneous or incompatible command line options" upon startup. Wondering if other Windows 10 users are having the same issue. For reference, here is my debug log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Sublime\Playground3\GraphQLServer1\node_modules\.bin;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\wamp64\bin\php\php5.6.25;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Git\cmd;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Yarn\bin;C:\Users\Brian\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Java\jre7\bin;C:\Users\Brian\AppData\Local\.meteor\;C:\Users\Brian\AppData\Roaming\npm;C:\Users\Brian\AppData\Local\atom\bin;C:\Users\Brian\AppData\Local\Yarn\.bin
10 verbose lifecycle [email protected]~start: CWD: C:\Sublime\Playground3\GraphQLServer1
11 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'babel-node index.js' ]
12 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `babel-node index.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd C:\Sublime\Playground3\GraphQLServer1
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
19 error node v7.8.0
20 error npm  v4.2.0
21 error code ELIFECYCLE
22 error errno 1
23 error [email protected] start: `babel-node index.js`
23 error Exit status 1
24 error Failed at the [email protected] start script 'babel-node index.js'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the ~name~ package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     babel-node index.js
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs ~name~
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls ~name~
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

Thanks!

bfitzsimmons703 avatar Apr 13 '17 13:04 bfitzsimmons703

Hi! @bcf3ah -- kind of amazing that it works at all! We are using mongodb-prebuilt in a reasonably normal way: https://github.com/tmeasday/create-graphql-server/blob/master/skel/index.js#L85 -- so I suspect maybe that package just doesn't work properly on win10? Have you looked any closer at it?

tmeasday avatar Apr 14 '17 12:04 tmeasday

The mongo-prebuilt package was also not available on the Raspberry Pi (arm-based CPU) so I installed a separate Mongo package for arm and modified the MONGO_PORT and MONGO_URL parameters to point to my Mongo install. Not ideal because I have to do this for each project but it works. I posted a more complete description of the steps I took here.

Thanks to @tmesday for a great project.

rgstephens avatar Apr 14 '17 13:04 rgstephens

Hi @tmeasday nope I haven't checked it out further. I was able to link it to MongoLab instead, Amazing project though, and I thank you for all the work you put into it!

bfitzsimmons703 avatar Apr 14 '17 17:04 bfitzsimmons703

So.. No solution? I'm having the same issue with win10 right now. Although using an existing MongoDB installation as @bcf3ah pointed out works just fine.

dukuo avatar Apr 15 '17 01:04 dukuo

The solution for me was to install Mongo separately and point create-graphql-server at it.

rgstephens avatar Apr 15 '17 15:04 rgstephens

Yeah it works fine that way, much appreciated

dukuo avatar Apr 15 '17 17:04 dukuo

Perhaps we should add a section to the readme about this, maybe point the error message at it? I haven't really made much attempt to make this work on anything but a mac at this stage.

PS it looks like we should also update the create script to not use sed as you can see the ~name~ is unreplaced in package.json. Not a big deal there, but probably a bigger deal in the authentication files where it generates a random key.

tmeasday avatar Apr 18 '17 13:04 tmeasday

I got the same error running Bash (Ubuntu) on Windows 10 and got it working the way @rgstephens described it. Although I have a weird error as well, but everything works (I can connect to http://localhost:3000/graphiql)

npm start
[email protected] start /home/davincilord/git_repos/fftcg
babel-node index.js

npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `babel-node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'babel-node index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fftcg package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel-node index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs fftcg
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls fftcg
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/davincilord/.npm/_logs/2017-05-07T19_35_54_100Z-debug.log

DaVinciLord avatar May 07 '17 19:05 DaVinciLord

Also not working for me on Windows 10 but just need to run Mongo yourself, as follows:

  1. Install mongodb and run "mongod" from the command line.

  2. From another command line window, go to your app folder and start your graphql server as follows:

SET MONGO_URL=mongodb://localhost:27017&&yarn start

Then the project works as-advertised :)

If you set a password or a different port when you run mongo, just correct the MONGO_URL above to reflect that.

Aadmaa avatar Aug 21 '17 15:08 Aadmaa

@Aadmaa send us a PR to https://github.com/tmeasday/create-graphql-server/blob/master/README.md? 🙇

tmeasday avatar Aug 22 '17 00:08 tmeasday

Will do @tmeasday

Aadmaa avatar Aug 22 '17 12:08 Aadmaa