ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.58k stars 2.84k forks source link

underscore module does not exist #3237

Closed BenaeSan closed 7 years ago

BenaeSan commented 7 years ago

Hello I've some issues at the installation of etherpad on my computer. I'm on nodejs -v8.2.1 windows 10 and I'm using etherpad releases 1.6.1. At the installation i've got first some issues with dependencies :

so i've fixed it with

npm install moduleName

The server is launching but when i create a pad, i've got:

image

that weird because underscore is in node_modules folder.

Thank by advance

lpagliari commented 7 years ago

Some users had reported that error on another issue, not sure if you've already checked that. I would start trying to ignore cache first (Ctrl+Shift+R), but if that does not work you might need a fresh install.

BenaeSan commented 7 years ago

So, i've tried without cache, and i've tried too to install etherpad on another computer, that definitively doen't work. It's strange : I've installed nodejs -v 8.2.1 then clone the repo launch installOnWindows.bat: image

launch start.bat: image i've got the welcome page where we can create pad, but after that:

TypeError: Cannot read property 'language' of undefined at c:\Repositories\etherpad-lite\src\node\hooks\express\specialpages.js:46:20 at Layer.handle [as handle_request] (c:\Repositories\etherpad-lite\node_modules\express\lib\router\layer.js:95:5) at next (c:\Repositories\etherpad-lite\node_modules\express\lib\router\route.js:131:13) at Route.dispatch (c:\Repositories\etherpad-lite\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (c:\Repositories\etherpad-lite\node_modules\express\lib\router\layer.js:95:5) at c:\Repositories\etherpad-lite\node_modules\express\lib\router\index.js:277:22 at param (c:\Repositories\etherpad-lite\node_modules\express\lib\router\index.js:349:14) at paramCallback (c:\Repositories\etherpad-lite\node_modules\express\lib\router\index.js:401:21) at c:\Repositories\etherpad-lite\src\node\hooks\express\padurlsanitize.js:28:11 at Object.exports.sanitizePadId (c:\Repositories\etherpad-lite\src\node\db\PadManager.js:208:5)

to fix the missing dependencies: image

image

relaunch the start.bat and then I got the underscore error.

Did I do something wrong ?

skupfer commented 7 years ago

This project is very outdated (starting with node modules and security warnings) and is not actively developed anymore... As far as the error message says some node modules (standard ones) might not work properly with node >= 7.0, so try downgrading node... or look for another project

BenaeSan commented 7 years ago

Is the Etherpad-lite project stopped ?

skupfer commented 7 years ago

No, not officially. As I said, try to downgrade node first please. But from what I can see the install script is weird. I suggest you use the latest windows package, not the Fancy install variant.

Try the following installOnWindows.bat if you prefer the fancy install variant... It is not fancy but I tried it and it was working. You have to start the installOnWindows.bat as Administrator. I hope I made no mistakes :-)


:: change directory to etherpad-lite root
cd /D "%~dp0\.."

:: Is node installed?
cmd /C node -e "" || ( echo "Please install node.js ( http://nodejs.org )" && exit /B 1 )

echo _
echo Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.

mkdir node_modules
cd /D node_modules
mklink /D "ep_etherpad-lite" "..\src"

cd /D "ep_etherpad-lite"
cmd /C npm install --loglevel warn || exit /B 1

cd /D "%~dp0\.."

echo _
echo Copying custom templates...
set custom_dir=node_modules\ep_etherpad-lite\static\custom
FOR %%f IN (index pad timeslider) DO (
  if NOT EXIST "%custom_dir%\%%f.js" copy "%custom_dir%\js.template" "%custom_dir%\%%f.js"
  if NOT EXIST "%custom_dir%\%%f.css" copy "%custom_dir%\css.template" "%custom_dir%\%%f.css"
)

echo _
echo Clearing cache...
del /S var\minified*

echo _
echo Setting up settings.json...
IF NOT EXIST settings.json (
  echo Can't find settings.json.
  echo Copying settings.json.template...
  cmd /C copy settings.json.template settings.json || exit /B 1
)

echo _
echo Installed Etherpad!  To run Etherpad type start.bat

Offtopic

But look at your warnings. They exist for a very long time (deprecated dependencies). Ok if it works why update. But there are warnings about a "RegEx DoS" issues in some modules and that you should update. Standard features like import/export with abiword/soffice or tidyhtml crashing the whole instance because of long known bugs. And there is more. Most plugins are outdated and if you need more features you have to rely on those outdated plugins. A lot are not working properly if you use a reverse proxy or are not being developed anymore (stated by their respective dev). There is one dev who is actively trying to improve some plugins and has a lot of his own but I guess it is simply too much.

BenaeSan commented 7 years ago

Thanks a lot, it working for now. For the project status, it a shame cause, it's a really useful project. I'll tried to help, if I can find some time, but my js and nodejs skills are a bit low for the moment.

lpagliari commented 7 years ago

Thanks for the input, @skupfer . I don't run Etherpad on Windows, but I hope it helps @BenaeSan to fix his problem.

Regarding Etherpad being stopped, I'm pretty sure that is not true. If you take a look on the commit list, you'll see improvements being made from time to time (10+ since May, for example, disregarding localisation updates sent automatically by https://translatewiki.ne). Is that good enough? No, I don't think so, and I agree 100% that we must fix those warnings that @skupfer mentioned.

Etherpad code is currently kept by devs who spend their free time improving it, which is why we need all the help we can get. It would be awesome if you could help us too. BTW, if the windows script on the repo is not working properly, could you submit a PR with the fix, please? It will be a great help for all the community!

Just a side note: I'm currently working on a project that is building a product that uses Etherpad as its editor. We are currently using 20 Etherpad plugins, and this number might grow in the future. Some of them already existed and we improved the actual code (ex: ep_comments, which is a pretty complex plugin), so you might find plugins that are still being improved.

Mozilla Foundation also adopted Etherpad Lite as its editor, and I believe they wouldn't do that if they didn't have the perspective to see it being improved in a short and long term.

It's pretty hard to find a good open source editor that is also flexible to be customised, so I would not simply "look for another project" -- that's why we've decided to go with Etherpad in the first place on my project. It would be much better if we could improve this one and keep all the nice work all contributors of Etherpad had done in the past. And that is why we need contributions like the one @skupfer mentioned on this issue. :-)

Sorry for the long text, it is not that nice to see someone telling the project you've been working on for the past 2 years say it is stopped. And don't get me wrong -- I agree with @skupfer about Etherpad needing more improvements! We just need more hands on this, not less.

BenaeSan commented 7 years ago

Yeah totally agree with you. I'm also integrating it in my project, that why I've been surprise to listen that the project is stopped, I have checked the commit activity before to choose Etherpad. Really if I can help, i'll try, the Etherpad project is really cool and is definitively upper than the others pads that I tried.

BenaeSan commented 7 years ago

@skupfer do you make the pull request or Do I do it ?

skupfer commented 7 years ago

@BenaeSan You can make the pull if you want. I am not sure whether this is the proper way to do it because you need admin rights (as I said) for the "mklink" command. Maybe one can do that better?

@lpagliari I am sorry if you felt offended because this definitely wasn't my intention! It is easy to say such things I know, especially if you are not able to contribute because you are not a js-dev.

I have seen the commits but that's something automated, right? I am using etherpad since 2013 if I remember correctly and since 2014 on my own server. The bugs never have been fixed since and the errors remained. I am not sure how to raise attention if there are even issues open/closed where those are mentioned (not only by myself).

Since this is a open source I was and am sure that you are spending your free time to develop and improve the project. Just like I did for the past weeks trying to dockerize this "properly" (mostly done but unsure whether I should publish it). I would gladly help you but I am neither a dev with enough knowledge nor a js-dev (I... hate this dom stuff). Even if I get started, it won't be in time and "we" (my fellow students and I) need a collaborative editor for shortening lecture documents and preparation. We love it despite having google docs or similar webapps because this is open source and self-hosted!

I love etherpad for what it is and I was searching for a month now for an alternative but wasn't happy with what I found. I just wish some plugins (like tables) or the other "standard" editor stuff would be implemented right into the code to make sure it is always working properly (you could use settings to activate them). E.x. ep_tables2 got abandoned the second time and is buggy (no pdf export compatibility, top rows line vanishing if you insert some into the top row...). Others like fileupload not working with a reverse proxy (security error) despite "fixed" as per commits. And there is so much more I wish I could fix :-)

EDIT: As you said yourself etherpad is "good open source editor that is also flexible to be customised". But this is the big problem here because devs of plugins might stop their development and bugs won't get fixed. The user cannot know this because they are still available for install.

Maybe this project gets more attention due to Mozilla, I really hope so!

Hope I didn't make it worse now... At first I only wanted to say sorry because it seemed like you felt offended by me. But I felt the need to explain myself :-) I wish you good luck with your project in the future. Maybe some day I am able to contribute more.

BenaeSan commented 7 years ago

ok done. That can help for now

rhelmer commented 7 years ago

@skupfer Etherpad uses a very open-ended plugin API, so unfortunately unmaintained plugins are likely to break. Firefox just went through a somewhat painful conversion from this sort of extension to using a set of standard APIs that are easier to maintain. The trade-off is that plugins can do literally anything which can be helpful, and doesn't require designing APIs to expose from Etherpad first (but still something to consider doing!)

Bugs in Etherpad itself are unfortunate but probably a fact of life - I don't know of any software projects, even big well-funded ones, that don't have a set of known bugs. It usually comes down to priorities and someone willing and able to work on them. I don't think this has any bearing on whether the project itself is actively maintained.

For the specific issue of outdated NPM modules (which plagues pretty much any open-source project) I'd suggest using https://github.com/apps/greenkeeper which automatically opens a PR which keeps dependencies up-to-date, it's a nice way to head this off before users run into it.