Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Some node modules missing in 0.44.0

Open bcalton opened this issue 10 years ago • 7 comments

Your Rocket.Chat version: 0.44.0

I recently updated rocket.chat from 0.43.0 to 0.44.0 by following the download/move/replace method detailed at https://rocket.chat/docs/installation/manual-installation/centos/#upgrade. I have a CentOS 7 system with a systemd service setup to mange rocket.chat and this failed to restart.

Doing a bit of digging, I tried running it myself and got this error:

[root@xxxx Rocket.Chat]# node main.js 
module.js:327
    throw err;
    ^

Error: Cannot find module 'fibers'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/opt/Rocket.Chat/programs/server/boot.js:1:75)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

It seems that some of the node modules required have bee omitted from the release. I have fixed this on my own install by doing this:

[root@xxxx server]# cd /opt/Rocket.Chat/programs/server
[root@xxxx server]# npm install
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
/
> [email protected] install /opt/Rocket.Chat/programs/server/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-46` exists; testing
Binary is fine; exiting
npm WARN cannot run in wd [email protected] node npm-rebuild.js (wd=/opt/Rocket.Chat/programs/server)
[email protected] node_modules/amdefine

[email protected] node_modules/underscore

[email protected] node_modules/meteor-promise

[email protected] node_modules/asap

[email protected] node_modules/semver

[email protected] node_modules/source-map-support

[email protected] node_modules/eachline
└── [email protected]

[email protected] node_modules/source-map

[email protected] node_modules/chalk
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected])

[email protected] node_modules/promise

[email protected] node_modules/fibers

bcalton avatar Oct 31 '16 11:10 bcalton

Have the same issue here on Windows 7. "Failed at the [email protected] install script 'node build.js || nodejs build.js".

yuchaozh avatar Oct 31 '16 15:10 yuchaozh

What version of NodeJS you have installed?

engelgabriel avatar Oct 31 '16 19:10 engelgabriel

We are using node v4.5.0 installed using n as per the instructions

[root@xxxx ~]# node -v
v4.5.0

bcalton avatar Oct 31 '16 19:10 bcalton

I am using v4.5.0 too. I changed Node js to v0.10.44. It fixed the issue.

yuchaozh avatar Nov 02 '16 04:11 yuchaozh

I upgraded from v0.10.44 to v4.5.0 by swapping all node_modules, ~/.npm, ~/.meteor, etc. like below.

mv /usr/lib/node_modules{,_}
mv /usr/local/bin/meteor{,_}
mv /usr/local/bin/node{,_}
mv /usr/local/bin/npm{,_}
mv /usr/local/include/node{,_}
mv /usr/local/lib/node_modules{,_}
mv /usr/local/n{,_}
mv /usr/local/share/man/man1/node.1{,_}
mv /usr/share/node{,_}
mv /usr/bin/node{,_}
mv ~/.meteor{,_}
mv ~/.npm{,_}
mv ~/.node-gyp{,_}

re-install Node.js,

sudo yum install nodejs npm
sudo -E npm i -g n
/usr/local/bin/n 4.5
sudo -E npm i -g npm@latest
curl https://install.meteor.com/ | sh

and build(if need), npm install.

# build
export NODE_ENV=production
meteor build --server https://example.com/ --directory /var/www/rocket.chat
# npm install
cd /var/www/rocket.chat/bundle/programs/server
npm install

peccu avatar Nov 02 '16 04:11 peccu

The same problem and solution is still the case in 0.45.0

bcalton avatar Nov 02 '16 14:11 bcalton

We aim to keep our Github issues for bugs and feature requests. This does not fit that criteria. Please see our guidelines for support. If you feel like we are closing in error, please re-open and add additional details about the bug or feature request.

MartinSchoeler avatar Jul 25 '17 16:07 MartinSchoeler