Gottwik / legolabels

Sort your LEGO like a pro
http://www.bricklabels.com/
13 stars 4 forks source link

npm start shows error #3

Closed craigstanton closed 7 years ago

craigstanton commented 7 years ago

Fresh checkout from git

npm install npm start

results in error message as below

lego_labels@1.0.0 start /Users/stantonca/Documents/Development/personal/legolabels enduro start

TypeError: Parameter "url" must be a string, not undefined at Url.parse (url.js:95:11) at Object.urlParse [as parse] (url.js:89:5) at module.exports (/Users/stantonca/Documents/Development/personal/legolabels/node_modules/mongodb/lib/url_parser.js:15:23) at connect (/Users/stantonca/Documents/Development/personal/legolabels/node_modules/mongodb/lib/mongo_client.js:289:16) at Function.MongoClient.connect (/Users/stantonca/Documents/Development/personal/legolabels/node_modules/mongodb/lib/mongo_client.js:113:3) at local_app.init (/Users/stantonca/Documents/Development/personal/legolabels/app/app.js:24:15) at website_api.forward (/Users/stantonca/Documents/Development/personal/legolabels/node_modules/enduro/libs/website_app.js:27:28) at /Users/stantonca/Documents/Development/personal/legolabels/node_modules/enduro/server.js:79:15 at enduro_server.run (/Users/stantonca/Documents/Development/personal/legolabels/node_modules/enduro/server.js:62:9) at enduro_configurator.read_config.then (/Users/stantonca/Documents/Development/personal/legolabels/node_modules/enduro/index.js:126:27)

Gottwik commented 7 years ago

Hey Craig, wow, thanks for the interest in the project. Sorry about this, my bad. There needs to be a mongodb url set up in the enduro_secret.json. I wrote more about this in the readme: https://github.com/Gottwik/legolabels#setting-mongodb and also added warning output to the console so somebody else won't have the same issue.

image

Feel free to add issues as soon as you find them and I will try to resolve them. To be honest I didn't really expected anybody to take interest such early on.

craigstanton commented 7 years ago

I saw it linked from bricks.stackexchange.com and wanted to have a go right away. I've installed MongoDB locally rather than paying for a mlab deployment. After some fiddling I think. have the connection string right but I still can't start it up fully. I created a new database 'myNewDB' and my endure_secret.json is as follows

{ "secret": { "s3": { "S3_KEY": "", "S3_SECRET": "" }, "DATABASE_URL": "mongodb://127.0.0.1/myNewDB" } }

Craigs-MBP:legolabels stantonca$ npm start

lego_labels@1.0.0 start /Users/stantonca/Documents/Development/personal/legolabels enduro start

[22:26:09 | +1.75] Production server started at port 5000 Juicebox is not set up
[22:26:09 | +0.12] Render started [22:26:09 | +0.06] Sass compiling started events.js:160 throw er; // Unhandled 'error' event ^

Error: ENOENT: no such file or directory, lstat '/Users/stantonca/Documents/Development/personal/legolabels/_src/assets/vendor/lodash/test/fp.html' Segmentation fault: 11

craigstanton commented 7 years ago

I've gone back to lab and found the free tier and put the connection string into endure_secret.json, but it is still failing to start enduro with the message above. I have also installed enduro as recommended in the ReadMe file npm i enduro -g

Gottwik commented 7 years ago

Which OS are you on? Could you check if you have to legolabels/_src/assets/vendor/lodash/test/fp.html file?

craigstanton commented 7 years ago

OS X 10.12 I do have that file, but it is empty. So are all the other files in that directory. There is also a asset directory which has files with some content

Gottwik commented 7 years ago

eh, could you maybe reinstall enduro by npm i enduro -g and try running it again. Maybe you catched some random buggy version, I was updating it today...

craigstanton commented 7 years ago

No change I'm afraid. The only thing a new install of endure changed was getting promised-handlebars@2.0.1

still reporting

[12:19:10 | +0.06] Sass compiling started events.js:160 throw er; // Unhandled 'error' event ^

Error: ENOENT: no such file or directory, lstat '/Users/stantonca/Documents/Development/personal/legolabels/_src/assets/vendor/lodash/test/fp.html'

Gottwik commented 7 years ago

Thanks for reporting this.

:-( I can't replicate this. Also doesn't make much sense why it would complain about some /test/fp.html file...

Could you create a temp folder somewhere else and run enduro create test, cd test and enduro to check if the basic enduro works?

Also which version of node are you running? You can find out by running node -v

craigstanton commented 7 years ago

The enduro commands you gave me worked fine. After running them it opened on localhost:3000. I also checked :5000 and that worked too.

[22:42:01 | +0.01] Production server started at port 5000 Error: ENOENT: no such file or directory, stat '/Users/stantonca/Documents/Development/tmp/test/_src/favicon.ico.html'

I'm on node 7.4.0

Gottwik commented 7 years ago

Hey @craigstanton I believe I managed to locate the issue and fixed it. Could you try pulling again, installing npm and running it? You know, git pull, npm i and finally npm start

craigstanton commented 7 years ago

That looks like it has done the trick. I can now get the landing page to appear on port 5000. Thank you

Gottwik commented 7 years ago

Uh, good to hear that we got this resolved. Feel free to contribute to the project or report any issues.