silexlabs / Silex

Silex live web creation, free/libre no-code website builder, next gen Webflow for the static web
http://www.silex.me
GNU Affero General Public License v3.0
2.24k stars 579 forks source link

silex-for-hosting-company wont build #906

Closed MACscr closed 5 years ago

MACscr commented 5 years ago

Seems to be an issue with iconv? Im no nodejs expert and not sure what eversions are needed for anything. I havent really seen a system requirements thread besides needing java and nodejs.

root@editor:/var/www/silex-for-hosting-company# npm i
npm WARN lifecycle silex-for-hosting-company@1.0.0~postinstall: cannot run in wd silex-for-hosting-company@1.0.0 npm run build (wd=/var/www/silex-for-hosting-company)
audited 8736 packages in 7.227s
found 7 vulnerabilities (3 low, 4 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
root@editor:/var/www/silex-for-hosting-company# npm audit fix
up to date in 6.251s
fixed 0 of 7 vulnerabilities in 8736 scanned packages
  7 vulnerabilities required manual review and could not be updated
root@editor:/var/www/silex-for-hosting-company#
root@editor:/var/www/silex-for-hosting-company# npm audit fix -v
6.4.1
root@editor:/var/www/silex-for-hosting-company# npm build
npm WARN build `npm build` called with no arguments. Did you mean to `npm run-script build`?
root@editor:/var/www/silex-for-hosting-company# npm run build

> silex-for-hosting-company@1.0.0 build /var/www/silex-for-hosting-company
> npm run build:templates && npm run build:components

> silex-for-hosting-company@1.0.0 build:templates /var/www/silex-for-hosting-company
> cp -r templates/* `node_modules`/silex-templates/

> silex-for-hosting-company@1.0.0 build:components /var/www/silex-for-hosting-company
> cp components/* `node_modules`/silex/src/prodotype/components/ && cd `node_modules`/silex/ && npm run build:prodotype

> silex@2.4.0 build:prodotype /var/www/silex-for-hosting-company/node_modules/silex
> mkdir -p dist/client/libs/prodotype/components &&  prodotype src/prodotype/components dist/client/libs/prodotype/components/ && prodotype src/prodotype/styles dist/client/libs/prodotype/styles/

Building /var/www/silex-for-hosting-company/node_modules/silex/src/prodotype/components to /var/www/silex-for-hosting-company/node_modules/silex/dist/client/libs/prodotype/components in current dir: /var/www/silex-for-hosting-company/node_modules/silex
Building template aligned-container
Building template animated-container
Building template autosize-section
Building template form
Building template hero-center
Building template hero-scroll-bottom
Building template hero-section
Building template json-box
Building template map
Building template share
Building template skill-bars
Building template slideshow
Building template test
writing /var/www/silex-for-hosting-company/node_modules/silex/dist/client/libs/prodotype/components/components.json
Building /var/www/silex-for-hosting-company/node_modules/silex/src/prodotype/styles to /var/www/silex-for-hosting-company/node_modules/silex/dist/client/libs/prodotype/styles in current dir: /var/www/silex-for-hosting-company/node_modules/silex
Building template text
writing /var/www/silex-for-hosting-company/node_modules/silex/dist/client/libs/prodotype/styles/components.json
root@editor:/var/www/silex-for-hosting-company#
root@editor:/var/www/silex-for-hosting-company#
root@editor:/var/www/silex-for-hosting-company# npm start

> silex-for-hosting-company@1.0.0 start /var/www/silex-for-hosting-company
> node index.js

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module '../build/Debug/iconv.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/var/www/silex-for-hosting-company/node_modules/iconv/lib/iconv.js:31:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/var/www/silex-for-hosting-company/node_modules/xml-stream/lib/xml-stream.js:4:22)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! silex-for-hosting-company@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the silex-for-hosting-company@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-01T21_33_13_065Z-debug.log
root@editor:/var/www/silex-for-hosting-company#
root@editor:/var/www/silex-for-hosting-company# nodejs -v
v10.15.1
root@editor:/var/www/silex-for-hosting-company# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.11 (jessie)
Release:    8.11
Codename:   jessie
MACscr commented 5 years ago

Additional info:

root@editor:/var/www/silex-for-hosting-company# cd node_modules/iconv
root@editor:/var/www/silex-for-hosting-company/node_modules/iconv# ls -lah
total 64K
drwxr-xr-x   7 root root 4.0K Mar  1 19:00 .
drwxr-xr-x 605 root root  20K Mar  1 20:54 ..
-rw-r--r--   1 root root 1.6K Oct 26  1985 LICENSE
-rw-r--r--   1 root root 5.5K Oct 26  1985 README.md
-rw-r--r--   1 root root 1.7K Oct 26  1985 binding.gyp
drwxr-xr-x   3 root root 4.0K Mar  1 19:00 deps
drwxr-xr-x   2 root root 4.0K Mar  1 19:00 lib
-rw-r--r--   1 root root 1.4K Mar  1 19:00 package.json
drwxr-xr-x   2 root root 4.0K Mar  1 19:00 src
drwxr-xr-x   2 root root 4.0K Mar  1 19:00 support
drwxr-xr-x   3 root root 4.0K Mar  1 19:00 test
root@editor:/var/www/silex-for-hosting-company/node_modules/iconv# npm view iconv version
2.3.2
lexoyo commented 5 years ago

I can see the same error here https://github.com/silexlabs/Silex/issues/787

Can you confirm that it is the same error and join the discussion there?

lexoyo commented 5 years ago

Forget it it is probably a different one What is your OS? I guess it is a MacOS @MACscr ?

In any case look at these discussions, they suggest several solutions https://github.com/bnoordhuis/node-iconv/issues/167 https://github.com/bnoordhuis/node-iconv/issues/69 https://stackoverflow.com/questions/22432144/cannot-find-module-build-debug-iconv-node

MACscr commented 5 years ago

I listed that info, but im running debian 8 with python 2.7.9. i do not have node-gyp and node rebuild didnt make a difference. Ive already done a fair bit of googling, hence why i was here asking about requirements.

Also, why do i have to do a build in the first place? Shouldnt this all install without it and without java?

lexoyo commented 5 years ago

Ok.. I have the same file structure in node_modules/iconv and the same version of iconv

What is your version of node?

Also, why do i have to do a build in the first place? Shouldnt this all install without it and without java?

This is the way it works with js and npm nowadays, you rebuild a lot of things. But I guess I could commit the built files of Silex, would it help? You would still have to run npm i

MACscr commented 5 years ago

I’m fine with building if it works, I just like to keep systems slim and takes a ton of packages to build.

I’m running v10.15.1

On Mar 1, 2019, at 6:35 PM, Alex Hoyau notifications@github.com wrote:

Ok.. I have the same file structure in node_modules/iconv and the same version of iconv

What is your version of node?

Also, why do i have to do a build in the first place? Shouldnt this all install without it and without java?

This is the way it works with js and npm nowadays, you rebuild a lot of things. But I guess I could commit the built files of Silex, would it help? You would still have to run npm i

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

lexoyo commented 5 years ago

Please use node version which is in .nvmrc file You can use nvm and do "nvm install"

I know it is frustrating, a lot of times it is like that with js projects

MACscr commented 5 years ago

Well I got it to build now that I know it requires a specific nodejs version and also got npm to actually start, but since i dont do dev work locally and npm only gives local access on port 6805, i had to setup nginx as a reverse proxy to it. I did set that up, but unfortunately it cant find any of the js files to run. Maybe im missing something, but couldnt this technically get built and supplied as a static library that could easily run within any web server and dynamically get its own paths/urls so it could literally be dropped in and run? Just seems a bit overly complex of a setup at the moment for what it does. Maybe its simply my ignorance of nodejs though and someone that comes from the simplicity of php. I have a lot of js experience, just not the server side style of nodejs.

BTW, thank you so much for your help, patience, and all the great work you do on this project. Please dont let any of my personal frustration take away from that.

MACscr commented 5 years ago

Here are the 404's im getting. Guessing maybe a path needs to be set that im not seeing in these docs. image

MACscr commented 5 years ago

Ah, i think i got the basics working when i created an ssh tunnel to 6805. I guess making things public is a different issue. When I have a better grasp of things, i will do my best to help you with the documentation as its definitely not a follow step 1, 2, and 3 and you will have a basic working install.

lexoyo commented 5 years ago

hi @MACscr how is it going?

MACscr commented 5 years ago

Eh, I have honestly tabled it right now. While I think the editor is pretty good, the backend structure, building process, etc, bother me quite a bit. Its a bit overly complex for what it does and has way too many modules and dependencies. I'm really wrestling with where I am going to go from here as I have a simple drag and drop editor absolute positioning that works well for its purpose, but needs some extra functionality that is going to take some considerable time. GrapeJS is well documented, has a decent size community, well structured code and docs, more straightforward UI, but doesnt have the great absolute positioning that silex does (that I 100% require). Nor does grape seem to have a lead developer that is as receptive as you have been and I really appreciate that.

Right now I am leaning towards just continuing work on my own so that I get what I need for the project without having to "hack" a third party system. Especially when I really don't have an interest in learning nodejs. Grapejs is pretty modular and can be used in a very simplified way, but also again has drag/resize support that your great system does. Ugh. Anyway, I appreciate your time and effort and will revisit it again soon.

lexoyo commented 5 years ago

Hi Mark

This is very interesting I think and I totally agree

I think this is mainly my fault, as I learned a lot by doing this on my spare time and sometimes I just don't have the energy to refactor - see these very critical issues which I should fix

Maybe we could start by creating a pre-build silex package on npm, would it help you? Still you would need to build it if you want to add components to it. The first step could be to store the build files as a release

What do you think, would you have time to help with that? I am sure @JbIPS could tell you how to add it to our current build...

lexoyo commented 5 years ago

Or we could convert the 100k limes of Javascript to typescript, since I have found this tool https://github.com/angular/clutz/blob/master/README.md#gents---closure-to-typescript-converter

I'll try it and tell you

lexoyo commented 5 years ago

We're not alone ;) https://www.lucidchart.com/techblog/2017/11/16/converting-600k-lines-to-typescript-in-72-hours/

MACscr commented 5 years ago

Eslint? That’s more the standard

On Mar 9, 2019, at 10:16 AM, Alex Hoyau notifications@github.com wrote:

We're not alone ;) https://www.lucidchart.com/techblog/2017/11/16/converting-600k-lines-to-typescript-in-72-hours/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

lexoyo commented 5 years ago

For 100K lines of code it is not enough I need to be able to get an error when a param is not of a good type etc

lexoyo commented 5 years ago

After 2h of work I still can not convert to typescript, but there is only 1 error left:

src/js/controller/context-menu-controller.js:36: ERROR - Invalid superclass for ContextMenuController
  34|                                                                                         
  35| // inherit from silex.controller.ControllerBase
  36| goog.inherits(silex.controller.ContextMenuController, silex.controller.ControllerBase);

src/js/controller/context-menu-controller.js:36: ERROR - Invalid superclass for ContextMenuController
  34|                                                                                         
  35| // inherit from silex.controller.ControllerBase
  36| goog.inherits(silex.controller.ContextMenuController, silex.controller.ControllerBase);

src/js/controller/css-editor-controller.js:37: ERROR - Invalid superclass for CssEditorController          
  35|
  36| // inherit from silex.controller.ControllerBase
  37| goog.inherits(silex.controller.CssEditorController, silex.controller.ControllerBase);     
  38|
  39|

src/js/controller/edit-menu-controller.js:44: ERROR - Invalid superclass for EditMenuController
  42|
  43| // inherit from silex.controller.ControllerBase
  44| goog.inherits(silex.controller.EditMenuController, silex.controller.ControllerBase);
  45|
  46|

19 times the same error, which is thrown here in the conversion tool "gents": https://github.com/angular/clutz/blob/3516fdb8cd2a11f5bdd6cb543717b5442d389b7d/src/main/java/com/google/javascript/gents/TypeConversionPass.java#L792

And this is an issue of the converter tool describing exactly this error: https://github.com/angular/clutz/issues/524

So now I see these possibilities

Then we need to compile with typescript and see what's work. Is someone willing to help?

To reproduce this:

lexoyo commented 5 years ago

Hello

I continued on this subject because it is important that silex can be installed locally. I think that because of the contributors but also because I believe silex as a Jekyll template editor is a very interesting tool. And Jekyll websites are created on the designer's local computer not online so...

Also I found many places where the code could be simplified with modern code and APIs which are today in all browsers

I spent 2 weekends on that for now and I am 50% of the way I think

lexoyo commented 5 years ago

I have to replace the whole stage component with a new one I started years ago https://lexoyo.me/stage/pub/

Feedbacks welcome :+1:

Screenshot from 2019-03-29 18-24-22

lexoyo commented 5 years ago

it is almost merged, this issue should be fixed soon anyone available to test?

lexoyo commented 5 years ago

This is now fixed, tested on linux and windows 7