Etherpad-lite: Cannot install etherpad-lite (Ubuntu Server)

Created on 17 Aug 2018  路  9Comments  路  Source: ether/etherpad-lite

I use Ubuntu instance created from AWS EC2, and follow the instructions of installing etherpad, after executing the bin/run.sh --root, it will fail:

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

[email protected] install /root/etherpad-lite/src/node_modules/wd
node scripts/build-browser-scripts

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

Error: Cannot find module '/root/etherpad-lite/src/node_modules/wd/scripts/build-browser-scripts'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node scripts/build-browser-scripts
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install 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/2018-08-17T04_46_57_247Z-debug.log

Most helpful comment

For a quick fix, I removed all the "devDependencies" from the package.json file.

"devDependencies": {
"mocha": "5.2.0",
"nyc": "^12.0.2",
"supertest": "3.0.0",
"wd": "1.10.3"
},

All 9 comments

also experiencing

I find the installation is successful on Google, but it not works on AWS EC2...

Hi,
this seems something related to the specific OS, possibly fixed improving documentation.

Could you please provide more details?

  • Ubuntu version (possibly a link to the image itself, or access to a failing image)
  • output of node --version and npm --version
  • exact procedure followed for installing Etherpad (to replicate the steps)

My little analysis from the outside, hoping it helps (I have no access to any AWS instances):

run.sh performs an npm install from inside the src directtory. Among other things, this should bring in the failing module [email protected].
Indeed, on my machine (Ubuntu desktop 18.04, node manually installed), after running run.sh the directory src/node_modules/wd exists. The scripts.install section of the package.json inside that directory calls node scripts/build-browser-scripts, that exists as src/node_modules/wd/scripts/build-browser-scripts.js and runs successfully here, instead failing inexplicably in your instance.

What happens if you do the following?

cd <BASEDIR>/src/node_modules/wd
ls - l scripts
npm install

Thanks for reply, here is the information

  • Ubuntu version:
    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.4 LTS
    Release: 16.04
    Codename: xenial
    (IMAGE: ami-ba602bc2)
  • Node version: 9.11.2 Npm version: 6.4.0
  • Procedure (operate as root):
    sudo su
    cd ~
    apt-get update
    apt install gzip git curl python libssl-dev pkg-config build-essential
    curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
    apt-get install -y nodejs
    git clone https://github.com/ether/etherpad-lite.git
    cd etherpad-lite
    bin/run.sh --root
  • When I type the following command:
    root@ip-172-31-31-136:~# cd <BASEDIR>/src/node_modules/wd
    bash: BASEDIR: No such file or directory

Hi,

  1. instead of sudo su always use sudo -i (it keeps the environment)
  2. <BASEDIR> was a placeholder. In your case its value would be /root/etherpad-lite

Could you try again on a clean machine making use of points 1 & 2?

  1. running as root is not a good practice, but that's another story :)

thanks, I have tried again on a clean machine, but I still find there is no wd inside the node_modules folder.

I am getting a very similar (but not identical) error related to node_modules/wd on CentOS 6

Error in shell:

> [email protected] install /opt/etherpad-lite/src/node_modules/wd
> node scripts/build-browser-scripts

/opt/etherpad-lite/src/node_modules/mkdirp/index.js:90
                    throw err0;
                    ^

Error: EACCES: permission denied, mkdir '/opt/etherpad-lite/src/node_modules/wd/build'
    at Object.mkdirSync (fs.js:729:3)
    at sync (/opt/etherpad-lite/src/node_modules/mkdirp/index.js:71:13)
    at Object.<anonymous> (/opt/etherpad-lite/src/node_modules/wd/scripts/build-browser-scripts.js:6:1)
    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 Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node scripts/build-browser-scripts`
npm ERR! Exit status 1

Error-related content from npm log:

1400 silly install [email protected]
1401 info lifecycle [email protected]\~install: [email protected]
1402 verbose lifecycle [email protected]\~install: unsafe-perm in lifecycle false
1403 verbose lifecycle [email protected]\~install: PATH: /usr/lib/node_modules/npm/node_modules/npm$
1404 verbose lifecycle [email protected]\~install: CWD: /opt/etherpad-lite/src/node_modules/wd
1405 silly lifecycle [email protected]\~install: Args: [ '-c', 'node scripts/build-browser-scripts'$
1406 silly lifecycle [email protected]\~install: Returned: code: 1  signal: null
1407 info lifecycle [email protected]\~install: Failed to exec install script
1408 timing action:install Completed in 121ms
1409 verbose unlock done using /root/.npm/_locks/staging-4d108950646ee67b.lock for /opt/et$
1410 timing stage:rollbackFailedOptional Completed in 203ms
1411 timing stage:runTopLevelLifecycles Completed in 7760ms
1412 verbose stack Error: [email protected] install: \`node scripts/build-browser-scripts\`
1412 verbose stack Exit status 1
1412 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules$
1412 verbose stack     at EventEmitter.emit (events.js:182:13)
1412 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules$
1412 verbose stack     at ChildProcess.emit (events.js:182:13)
1412 verbose stack     at maybeClose (internal/child_process.js:961:16)
1412 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:2$
1413 verbose pkgid [email protected]
1414 verbose cwd /opt/etherpad-lite/src
1415 verbose Linux 2.6.32-696.18.7.el6.x86_64
1416 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--no-save" "--loglevel" "warn"
1417 verbose node v10.9.0
1418 verbose npm  v6.2.0
1419 error code ELIFECYCLE

For a quick fix, I removed all the "devDependencies" from the package.json file.

"devDependencies": {
"mocha": "5.2.0",
"nyc": "^12.0.2",
"supertest": "3.0.0",
"wd": "1.10.3"
},

I _think_ that @treysp could be a directory permission problem (EACCES: permission denied, mkdir '/opt/etherpad-lite/src/node_modules/wd/build': maybe the same installation was tried twice on the same directory with users of different privileges? Or something similar...).

@clayu workaround bypasses the problem, but I think is a good idea anyways, because it exposes a weakness in the current code base: I am not sure it is wise to ask Etherpad users to install the devDependencies even when they just want to run the program.

For this, a better startup strategy (that gets rid of the current bash scripts) is worth some investigation.

Closing for now, thanks.

Was this page helpful?
0 / 5 - 0 ratings