Samsung / Dexter

Dexter is a static analysis platform to find and remove defects efficiently and immediately during the coding-time.
BSD 2-Clause "Simplified" License
57 stars 33 forks source link

[dexter-server] TypeError: Object -p has no method 'startsWith' #57

Closed alxpark closed 8 years ago

alxpark commented 8 years ago

When I start dexter-server, I faced the below error ;

/vagrant/project/dexter-server/util/dexter-util.js:178 return key.startsWith('-'); ^ TypeError: Object -p has no method 'startsWith' at isValidCliOption (/vagrant/project/dexter-server/util/dexter-util.js:178:16) at /vagrant/project/dexter-server/util/dexter-util.js:128:12 at arrayEach (/vagrant/project/dexter-server/node_modules/lodash/index.js:1289:13) at Function. (/vagrant/project/dexter-server/node_modules/lodash/index.js:3345:13) at baseWrapperValue (/vagrant/project/dexter-server/node_modules/lodash/index.js:2768:30) at LodashWrapper.wrapperValue (/vagrant/project/dexter-server/node_modules/lodash/index.js:6124:14) at Object.exports.getCliOptions (/vagrant/project/dexter-server/util/dexter-util.js:133:8) at setRunOptionsByCliOptions (/vagrant/project/dexter-server/server.js:91:27) at initialize (/vagrant/project/dexter-server/server.js:82:5) at Object. (/vagrant/project/dexter-server/server.js:79:1)

Minjung-Baek commented 8 years ago

dexter-server was tested on v4.2.1 of nodejs. The string.startsWith() function is specified at ES6: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith

I guess the version of nodejs does not support the new string functions. We recommend the node version upgrade. (node 4.2+)

But you can try it with '-harmony' option. Refer to the following URL: http://www.2ality.com/2013/04/nodejs-harmony.html Also you can read this: https://nodejs.org/en/docs/es6/

alxpark commented 8 years ago

Hi Minjung,

It's correct. My nodejs was 0.10.25 running on Ubuntu. I installed using apt-get and it was this version by default. I reinstalled nodejs for v5.x by the below and working fine. http://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version

Thank you for your feedback.

Cheers, Alex

Minjung-Baek commented 8 years ago

Thank you for your interest :+1: