didimitrie / future.speckle

Beta.Speckle is an online parametric model viewer. It enables sharing with your clients/stakeholders/community flexible designs, not just static artefacts.
http://beta.speckle.xyz
MIT License
23 stars 5 forks source link

deploying on windows: windows cant handle '|' in filenames #25

Open ionutanton opened 8 years ago

ionutanton commented 8 years ago

I tried installing my own server on a Windows 10 box. managed to get auth0 and a local mangodb running. started the main server with npm run watch-simple and the skpw with npm run watch-remote the remote on spkw does not work propperly, it outpus a lot of errors. error_160221.txt

Well, the server runs, i can use auth0 and i get to my dashboard. but when i try to upload, the file is uploaded and then nothing happens. and there is no output in the npm console for future.speckle.

Thank you

didimitrie commented 8 years ago

sass and jade need to be installed globally as far as i can tell from here:

'sass' is not recognized as an internal or external command, operable program or batch file.

sass might be tricky on win - you might need to get ruby. check install instructions here. or try npm install -g node-sass

I'm not sure why jade is running into troubles - permissions maybe? Error: ENOENT: no such file or directory, lstat 'D:\Documente\Documents\GitHub\future.speckle\spkw\src\jade\*.jade' if the path looks correct then it might be that.

damn windoz.

didimitrie commented 8 years ago

reading more properly your question: you don't need to start the viewer, he should be fine as is;

some q:

ionutanton commented 8 years ago

so, i did install ruby and globaly install node-sass and jade. now the watch-sass works, watch-js works, but watch-jade does not. same error on jade as above. to answer the questions above:

Also i tried installing a ubuntu virtual box and installing everything propperly. running the npm run watch works, launches the webserver, i can authenticate, but same problem with upload. unfortunately on linux nouislider does not install with npm.

didimitrie commented 8 years ago

does the path to where jade wants to look at files exist? ('D:\Documente\Documents\GitHub\future.speckle\spkw\src\jade\*.jade')

ionutanton commented 8 years ago

path is ok and files are there.

didimitrie commented 8 years ago
ionutanton commented 8 years ago

tried the removing the dot, but doesn't work.

ionutanton commented 8 years ago

made some progress. made jade to work, and nodemon and sass. need to install globaly: browserify, jade, node-sass. need to install ruby for sass as stated above.

Then a few tricks for the package.json to work on windows.

  1. on jade lines after /src/jade/ there shoudnt be any *.jade. this messes up.
  2. all the single quotes ' should be \" instead.

something like this: "scripts": { "watch-sass": "sass --watch spkw/src/sass/SPKSingle.scss:spkw/dist/css/SPKSingle.css spkw/src/sass/SPKDouble.scss:spkw/dist/css/SPKDouble.css", "watch-jade": "jade --watch spkw/src/jade/ -o spkw/dist/ -P", "build-js-single": "browserify spkw/src/js/SPKSingle.js -o spkw/dist/js/SPKSingle.js", "build-js-double": "browserify spkw/src/js/SPKDouble.js -o spkw/dist/js/SPKDouble.js", "watch-js": "nodemon -e js -w spkw/src/js -x \"npm run build-js-single\" & nodemon -e js -w spkw/src/js -x \"npm run build-js-double\"", "watch-remote": "npm run watch-sass & npm run watch-jade & npm run watch-js", "watch": "npm run watch-remote & nodemon server.js --ignore 'uploads'", "watch-simple": "nodemon server.js --ignore 'uploads' --ignore 'spkw'"

now i can run all the scripts without any errors.

ionutanton commented 8 years ago

but my problem persists. i cant upload new models. when i upload the console sais: upload is done, waiting for the server side processing and the running npm has a POST line: POST /api/uploads/ 200 214ms i actualy added some lines to the upload script to see if the server realy gets there. added some console.log("something"); the the app.post function. but the npm window doesnt register anything. where should i look for these console messages?

didimitrie commented 8 years ago

Sorry I didn't have time to check up on this. I'll be a bit more free after Wednesday to get back to dev and debug.

ionutanton commented 8 years ago

just a small update. i saw an error in the console when i run the server. it's related to bson: { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } and bson comes with mongoose this time. The error is in the busboy middleware that leads to multer. js-bson: Failed to load c++ bson extension, using pure JS version. body-parser deprecated bodyParser: use individual json/urlencoded middlewares at server.js:31:9.

Seems like bson needs a c++ compiler to run. Will keep digging and keep posted.

PS: changing multer to something else will have the same result i guess. PS2: its deffinetly a windows thing.

ionutanton commented 8 years ago

Strike last post. solved the bson problem. it's not that.

tried changing multer to formidable, same result. at some point i get an error from uploader, or it doesn't manage to write the file or something.

ionutanton commented 8 years ago

Solved.

please change the name of the file in modelmanager.js function getName ( req ) { return Date.now() + '-' + req.user.id.replace("|",".") + '-' + shortid.generate(); }

Actualy windows cant handle '|' in filenames.

didimitrie commented 8 years ago

Reopened as bug!