Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! Cannot read property '0' of undefined when starting Rocket Chat server #9499

Closed
distlibs opened this issue Jan 25, 2018 · 3 comments · Fixed by #9504
Closed

npm ERR! Cannot read property '0' of undefined when starting Rocket Chat server #9499

distlibs opened this issue Jan 25, 2018 · 3 comments · Fixed by #9504
Milestone

Comments

@distlibs
Copy link

Description:

I git pull latest changes form develop branch and then start Rocket Chat server using command meteor I get npm error:
npm ERR! Cannot read property '0'

I think its related with Live Chat building. Logs then error occurs:

63 silly unbuild inherits
64 info lifecycle undefined~preuninstall: undefined
65 info lifecycle undefined~uninstall: undefined
66 silly unbuild block-stream
67 info lifecycle undefined~preuninstall: undefined
68 info lifecycle undefined~uninstall: undefined
69 verbose unlock done using /home/adminas/.npm/_locks/staging-7f707e5c6158094e.lock for /home/adminas/dev/Rocket.Chat/packages/rocketchat-livechat/.app/node_modules/.staging
70 verbose stack TypeError: Cannot read property '0' of undefined
70 verbose stack     at rmStuff (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/lib/unbuild.js:61:24)
70 verbose stack     at tryCatcher (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
70 verbose stack     at ret (eval at makeNodePromisifiedEval (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
70 verbose stack     at lifecycle.then.then (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/lib/install/action/unbuild.js:12:12)
70 verbose stack     at tryCatcher (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
70 verbose stack     at Promise._settlePromiseFromHandler (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
70 verbose stack     at Promise._settlePromise (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
70 verbose stack     at Promise._settlePromise0 (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
70 verbose stack     at Promise._settlePromises (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
70 verbose stack     at Promise._fulfill (/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
70 verbose stack     at /home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
70 verbose stack     at <anonymous>
71 verbose cwd /home/adminas/dev/Rocket.Chat/packages/rocketchat-livechat/.app
72 verbose Linux 4.13.0-26-generic
73 verbose argv "/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node" "/home/adminas/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm" "install" "--production"
74 verbose node v8.9.3
75 verbose npm  v5.5.1
76 error Cannot read property '0' of undefined
77 verbose exit [ 1, true ]

I tried install latest Ubuntu 16.0.3 and start Rocket Chat server using commands:

git clone https://github.com/RocketChat/Rocket.Chat.git
cd Rocket.Chat
meteor npm start

But I get same error. Maybe same linux dependencies missing. Somewhere a month ago I don't got this error and all worked fine.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.61.0-develop (fbbe16c)
  • Operating System: Ubuntu 16.04.3 64-bit
  • Deployment Method(snap/docker/tar/etc): git pull
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • Node Version: 8.9.3 - x64
@rodrigok
Copy link
Member

@distlibs could you try remove your node_modules folders, pull the latest changes and test?

rm -rf node_modules
rm -rf packages/rocketchat-livechat/.app/node_modules
rm -rf packages/rocketchat-livechat/.app/package-lock.json
meteor npm install
meteor npm start

It's a NPM problem, we solve that preventing NPM to create the package-lock file inside the livechat package.

@distlibs
Copy link
Author

distlibs commented Jan 25, 2018

@rodrigok Thanks, it works! I think you can remove packages/rocketchat-livechat/.app/package-lock.json from git repository. When I check git status, it prints:

modified:   package-lock.json
deleted:    packages/rocketchat-livechat/.app/package-lock.json

@rodrigok
Copy link
Member

@distlibs Thanks, I'll remove, maybe someone else added it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants