Node: Error on sample script!

Created on 22 Jun 2018  路  3Comments  路  Source: nodejs/node

Definitely this trash called Javascript is dead! I give up to use this technology :-1:
The samples of Nodejs site doesnt work!
Or team doesn't update site, or .... throw it to the trash.

https://nodejs.org/dist/latest-v10.x/docs/api/synopsis.html
https://nodejs.org/en/docs/guides/getting-started-guide/

imagem

wrong repo

Most helpful comment

@codesearcher

Please don't be angry. There are no issues with Node.js or it's documentation. You are using old version of Node.js (according to the stack trace, I suppose it is v0.10.25). The current version is v10.5.0.

Node.js v0.10.25 doesn't support arrow functions (the => token you're seeing is part of an arrow function, they are introduced in Node.js v4.x). The W3schools tutorial you've found is written using standard function notation, so it works in your version.

I would suggest you to update your Node.js (you can check the version of your node by running node -v from the command prompt). Hope it helps.

All 3 comments

I found a solution on another site: https://www.w3schools.com/nodejs/met_http_createserver.asp
imagem

PLEASE team: update at least the beginer's samples.

I give up to use this technology

Well, bye then. But next time please the right forum, nodejs/help..

@codesearcher

Please don't be angry. There are no issues with Node.js or it's documentation. You are using old version of Node.js (according to the stack trace, I suppose it is v0.10.25). The current version is v10.5.0.

Node.js v0.10.25 doesn't support arrow functions (the => token you're seeing is part of an arrow function, they are introduced in Node.js v4.x). The W3schools tutorial you've found is written using standard function notation, so it works in your version.

I would suggest you to update your Node.js (you can check the version of your node by running node -v from the command prompt). Hope it helps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmichae3 picture jmichae3  路  3Comments

willnwhite picture willnwhite  路  3Comments

fanjunzhi picture fanjunzhi  路  3Comments

Brekmister picture Brekmister  路  3Comments

cong88 picture cong88  路  3Comments