正在尝试从git hub node.js v6.10.0版安装MERN社交网络

正在尝试从git hub node.js v6.10.0版安装MERN社交网络,node.js,vue.js,npm-install,Node.js,Vue.js,Npm Install,我正在尝试安装MERN社交网络 来自git hub 面对这个错误: www@www-PC MINGW64 /d/Vue-Mini-Social-Network-master $ npm start > vue-mini-social-network@1.0.0 start D:\Vue-Mini-Social-Network-master > nodemon app.js [nodemon] 1.18.3 [nodemon] to restart at any time, ent

我正在尝试安装MERN社交网络 来自git hub

面对这个错误:

www@www-PC MINGW64 /d/Vue-Mini-Social-Network-master
$ npm start

> vue-mini-social-network@1.0.0 start D:\Vue-Mini-Social-Network-master
> nodemon app.js

[nodemon] 1.18.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node app.js`
D:\Vue-Mini-Social-Network-master\routes\user-routes.js:25
app.post('/user/signup', async (req, res) => {
                               ^
SyntaxError: Unexpected token (
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\Vue-Mini-Social-Network-master\app.js:19:13)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
[nodemon] app crashed - waiting for file changes before starting...

www@www-PC MINGW64/d/Vue迷你社交网络主机
$npm开始
>vue迷你社交网站-network@1.0.0启动D:\Vue迷你社交网络主机
>nodemon app.js
[nodemon]1.18.3
[nodemon]要随时重新启动,请输入'rs'`
[nodemon]正在观看:**
[nodemon]正在启动`node app.js`
D:\Vue迷你社交网络主机\routes\user routes.js:25
app.post('/user/signup',异步(req,res)=>{
^
SyntaxError:意外标记(
在Object.exports.runInThisContext(vm.js:76:16)
在模块处编译(Module.js:542:28)
在Object.Module.\u extensions..js(Module.js:579:10)
在Module.load(Module.js:487:32)
在tryModuleLoad时(module.js:446:12)
在Function.Module.\u加载(Module.js:438:3)
at Module.require(Module.js:497:17)
根据需要(内部/module.js:20:19)

你在评论中说你的Node.JS版本是
v6.10.0
,不幸的是,这个版本不支持
async/await
功能

您可以在这里查看:

Async/await
支持从版本
7.0.0
开始,您需要在其中添加
--harmony
标志以启用ES6/ES7功能。从
7.6.0
开始支持

因此,有多种方法可以实现相同的结果

1) 使用
Promise
而不是
async/await

2) 使用
babel
将代码传输到ES5中。如果您使用的是webpack(主要用于前端产品),则可以通过
babel load
运行代码来完成此操作
3) 您可以将节点更新为
>7.6.x

注意:如果您在该存储库的
package.json
中看到,建议在该项目中使用node>8(根据作者)


请发布您的节点版本。
node-v
myversionv6.10.0如果这解决了您的问题,我将尝试thanx grt effort(检查后)然后将答案标记为已接受,以帮助解决同一问题的其他人。www@www-PC MINGW64/d/Vue迷你社交网络主机$npm开始>Vue迷你社交网络-network@1.0.0启动D:\Vue Mini Social Network master>nodemon app.js[nodemon]1.18.3[nodemon]要随时重新启动,请输入
rs
[nodemon]观看:[nodemon]正在启动
node app.js
app running..如果运行的代码正常,请将其标记为已接受。问题正下方有一个勾号按钮。
"engines": {
  "node": ">= 8.0.0"
},