croqaz / clean-mark

Convert an article into clean text
MIT License
600 stars 51 forks source link

An error has occurred on the Ubuntu16.04. #8

Closed CoderWonder closed 4 years ago

CoderWonder commented 4 years ago

Firstly,I executed the following command。 $ sudo ln -s /usr/bin/nodejs /usr/bin/node

Secondly, `$ clean-mark "https://en.wikipedia.org/wiki/Donald_Trump"

/usr/local/lib/node_modules/clean-mark/bin/clean-mark:8 const { urlPath } = require('../lib/util') ^

SyntaxError: Unexpected token { at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:442:10) at startup (node.js:136:18) at node.js:966:3 `

croqaz commented 4 years ago

Hi. From the error, you seem to have a very old version of Node.js. If you call /usr/bin/node --version what do you get? I think for Clean-mark you need at least v6.0 , maybe even v8.0. Both of them are very very old versions BTW, check here: https://nodejs.org/en/download/releases/