Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10 MongoDB Error 2 #28

Open
bfitzsimmons703 opened this issue Apr 13, 2017 · 11 comments
Open

Windows 10 MongoDB Error 2 #28

bfitzsimmons703 opened this issue Apr 13, 2017 · 11 comments

Comments

@bfitzsimmons703
Copy link

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 npm@4.2.0
3 info using node@v7.8.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ~name~@1.0.0~prestart: ~name~@1.0.0
6 silly lifecycle ~name~@1.0.0~prestart: no script for prestart, continuing
7 info lifecycle ~name~@1.0.0~start: ~name~@1.0.0
8 verbose lifecycle ~name~@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle ~name~@1.0.0~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 ~name~@1.0.0~start: CWD: C:\Sublime\Playground3\GraphQLServer1
11 silly lifecycle ~name~@1.0.0~start: Args: [ '/d /s /c', 'babel-node index.js' ]
12 silly lifecycle ~name~@1.0.0~start: Returned: code: 1  signal: null
13 info lifecycle ~name~@1.0.0~start: Failed to exec start script
14 verbose stack Error: ~name~@1.0.0 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 ~name~@1.0.0
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 ~name~@1.0.0 start: `babel-node index.js`
23 error Exit status 1
24 error Failed at the ~name~@1.0.0 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!

@tmeasday
Copy link
Owner

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?

@rgstephens
Copy link

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.

@bfitzsimmons703
Copy link
Author

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!

@dukuo
Copy link

dukuo commented Apr 15, 2017

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.

@rgstephens
Copy link

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

@dukuo
Copy link

dukuo commented Apr 15, 2017

Yeah it works fine that way, much appreciated

@tmeasday
Copy link
Owner

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.

@DaVinciLord
Copy link

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
fftcg@1.0.0 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! fftcg@1.0.0 start: `babel-node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fftcg@1.0.0 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

@Aadmaa
Copy link
Contributor

Aadmaa commented Aug 21, 2017

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.

@tmeasday
Copy link
Owner

@Aadmaa
Copy link
Contributor

Aadmaa commented Aug 22, 2017

Will do @tmeasday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants