linux下安装node.js使用make命令的时候报错请大神帮忙看下什么原因。
发布于 8 年前 作者 crazyshoubin 7933 次浏览 来自 问答

mutex.h:210: 错误:expected ‘)’ before ‘const’ …/deps/v8/src/base/platform/mutex.h:210: 错误:‘void operator=(const LockGuard&)’必须是一个非静态的成员函数 …/deps/v8/src/base/platform/mutex.h:211: 错误:expected declaration before ‘}’ token make[1]: *** [/usr/src/node-v6.2.0/out/Release/obj.target/v8_base/deps/v8/src/accessors.o] 错误 1 make[1]: Leaving directory /usr/src/node-v6.2.0/out’ …/deps/v8/src/base/platform/mutex.h:69: 错误:expected unqualified-id before ‘private’ …/deps/v8/src/base/platform/mutex.h:89: 错误:‘friend’用在类外 …/deps/v8/src/base/platform/mutex.h:91: 错误:expected unqualified-id before ‘const’ …/deps/v8/src/base/platform/mutex.h:91: 错误:expected ‘)’ before ‘const’ …/deps/v8/src/base/platform/mutex.h:91: 错误:‘void v8::base::operator=(const v8::base::Mutex&)’必须是一个非静态的成员函数 …/deps/v8/src/base/platform/mutex.h:104: 错误:expected initializer before ‘<’ token …/deps/v8/src/base/platform/mutex.h:130: 错误:变量‘v8::RecursiveMutex v8::final’有初始值设定,但是类型不完全 …/deps/v8/src/base/platform/mutex.h:131: 错误:expected primary-expression before ‘public’ …/deps/v8/src/base/platform/mutex.h:131: 错误:expected ‘}’ before ‘public’ …/deps/v8/src/base/platform/mutex.h:131: 错误:expected ‘,’ or ‘;’ before ‘public’ …/deps/v8/src/base/platform/mutex.h:133: 错误:expected constructor, destructor, or type conversion before ‘;’ token …/deps/v8/src/base/platform/mutex.h:155: 错误:‘Mutex’未声明 …/deps/v8/src/base/platform/mutex.h:155: 错误:expected initializer before ‘NativeHandle’ …/deps/v8/src/base/platform/mutex.h:157: 错误:expected constructor, destructor, or type conversion before ‘&’ token …/deps/v8/src/base/platform/mutex.h:160: 错误:expected initializer before ‘&’ token …/deps/v8/src/base/platform/mutex.h:164: 错误:expected unqualified-id before ‘private’ …/deps/v8/src/base/platform/mutex.h:170: 错误:expected unqualified-id before ‘const’ …/deps/v8/src/base/platform/mutex.h:170: 错误:expected ‘)’ before ‘const’ …/deps/v8/src/base/platform/mutex.h:170: 错误:‘void v8::operator=(const v8::RecursiveMutex&)’必须是一个非静态的成员函数 …/deps/v8/src/base/platform/mutex.h:184: 错误:expected initializer before ‘<’ token …/deps/v8/src/base/platform/mutex.h:202: 错误:‘LockGuard final’声明为模板 …/deps/v8/src/base/platform/mutex.h:203: 错误:expected primary-expression before ‘public’ …/deps/v8/src/base/platform/mutex.h:203: 错误:expected ‘}’ before ‘public’ …/deps/v8/src/base/platform/mutex.h:205: 错误:‘~LockGuard’未声明为成员 …/deps/v8/src/base/platform/mutex.h:207: 错误:expected unqualified-id before ‘private’ …/deps/v8/src/base/platform/mutex.h:210: 错误:expected unqualified-id before ‘const’ …/deps/v8/src/base/platform/mutex.h:210: 错误:expected ‘)’ before ‘const’ …/deps/v8/src/base/platform/mutex.h:210: 错误:‘void operator=(const LockGuard&)’必须是一个非静态的成员函数 …/deps/v8/src/base/platform/mutex.h:211: 错误:expected declaration before ‘}’ token make[1]: *** [/usr/src/node-v6.2.0/out/Release/obj.target/v8_base/deps/v8/src/accessors.o] 错误 1 make[1]: Leaving directory/usr/src/node-v6.2.0/out’ make: *** [node] 错误 2

5 回复

首先,不建议编译安装,因为要求gcc版本太高,高到除非是mac或者是最新的centos7.X否则,你再config的时候就有警报提示; 其次,仍然是不建议编译,因为从版本迭代以及版本更新的角度看,很不利于运维; 最后,还是不建议编译,因为有那功夫你已经写了一个demo了,除非你需要写C++插件; BTW:从你的错误日志看,没有任何明确的信息,但是推测是gcc版本过低导致的,确认方式就是在make前,先看下config的结果

接楼上,建议直接下载压缩包安装,然后配置路径,简单快捷。

https://github.com/wang-weifeng/Centos6.5.nodejsv4.x.express 我也在这里发过一个教程你可以点开我头像

谢谢各位基本已经了解问题的原因了,正在解决

@crazyshoubin 我也遇到了同样的问题,请问是什么原因呢 是GCC版本太低了吗? 谢谢

回到顶部