Error when install nodejs with sequelize on centos

quang tran

This is my version of nodejs: 6.17.1 and sequelize 6.4.0. I folow this: https://bezkoder.com/react-node-express-mysql/. And I got error:

> /app/nodejs/node_modules/sequelize/lib/sequelize.js:277
>       ...options

> SyntaxError: Unexpected token ...
>     at createScript (vm.js:56:10)
>     at Object.runInThisContext (vm.js:97:10)
>     at Module._compile (module.js:549:28)
>     at Object.Module._extensions..js (module.js:586:10)
>     at Module.load (module.js:494:32)
>     at tryModuleLoad (module.js:453:12)
>     at Function.Module._load (module.js:445:3)
>     at Module.require (module.js:504:17)
>     at require (internal/module.js:20:19)
>     at Object.<anonymous> (/app/nodejs/node_modules/sequelize/index.js:8:18)

So am I wrong something ?

Solved with this code:

+ sudo yum install nodejs
+ node --version
+ npm --version
+ which node
+ which npm
+ curl -sL https://rpm.nodesource.com/setup_12.x | bash -
+ ls -la /etc/yum.repos.d/|grep nodesource
+ sudo yum remove -y nodejs npm
+ sudo yum list available nodejs
+ sudo yum install nodejs
+ node --version
+ npm --version

Credit: https://matthiashoys.wordpress.com/2020/01/15/how-to-upgrade-node-js-from-v6-to-v12-on-centos-linux-7/

Luke Celitan

The spread operator (...) is not supported by your node version. You need version above 8.6.

follow this link, to find out specific support methods in node, https://node.green/#ES2015

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error when install GTK+ 3.0.5 on CentOS

'Table not found' error when inserting row. Sequelize and nodejs

Error: No Sequelize instance passed in Nodejs

NodeJS Azure Sequelize SQL Server - Error: Please install tedious package manually

Error detecting Nodejs when trying to install "Codux" on windows

Sequelize for NodeJS and hasMany using UUID error

Error: db.sequelize.define is not a function in NodeJS

Nodejs Sequelize

NodeJS App npm install error

Unusual repos error when install postgresql11 on CentOS7

Error: Unable to find a match phpmyadmin when i try to install phpmyadmin on centos

Sequelize Connection Error when creating model

Error while Accessing mysql through Sequelize (Express/NodeJS)

NodeJS sequelize timestamps disabled but still getting Unknown column 'createdAt' error

NodeJS sequelize auto generate models and run migrations SQL syntax error

What is used in Nodejs - Sequelize for removing spaces when insert in DB using

Nodejs Sequelize and passport Js, stuck on executing query when registing user

Error when install pip

Error when install Cocoapods

Error when install xampp

Error When installing Tesseract 3.05 in Centos7 "error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package"

CentOS 7 install PostgreSQL dependency error

Install java on Centos 7 and Command not known error

Fail install mongodb on Centos 7 with Package error

How to install Nodejs on CentOS 7 without Internet connection with root permission?

Typescript error when building nodeJs

Nodejs sequelize bulk upsert

Sequelize Migration NodeJS

Sequelize model loading in NodeJS