/Users/test/WebstormProjects/testtt/node_modules/node-readability/node_modules/jsdom/lib/jsdom.js:3
`jsdom 4.x onward only works on io.js or Node.js 4 or newer: https://github.co
^
[SyntaxError: Unexpected token ILLEGAL]
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/test/WebstormProjects/testtt/node_modules/node-readability/src/readability.js:1:75)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/test/WebstormProjects/testtt/api/services/readabilityService.js:5:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
伊谢尔伦2017-04-17 13:50:50
Because your node version is too low,
jsdom 4.x onward only works on io.js or Node.js 4 or newer
天蓬老师2017-04-17 13:50:50
Check the node version difference between your two macs. It seems that your node version is too low.
天蓬老师2017-04-17 13:50:50
Thanks for the invitation. As mentioned above, the version is low~just download the latest version~
PHP中文网2017-04-17 13:50:50
node -v checks node version
You can install node version management tools such as nvm or n on mac
PHP中文网2017-04-17 13:50:50
According to my understanding, this kind of node project not only needs to indicate the version of the dependent package, but also needs to indicate the version of other dependencies, such as the running environment version number and the build tool version number, operating system, database version, etc. , because the node changes too fast
PHP中文网2017-04-17 13:50:50
node version problem
Also develop a good habit. Every time you install a new dependent module during the project life cycle, npm install xxx --save
npm adds --save. The version information of the dependent module will be written to package.json.
In this way, every time you change the server deployment, you can directly cp the package file and execute npm install, and you can deploy it according to the information (restore) in package.json and rely on the running environment
Of course the most important thing is node version compatibility.