Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centos 6 64 无法运行 #19

Open
chijiao opened this issue Apr 28, 2017 · 3 comments
Open

centos 6 64 无法运行 #19

chijiao opened this issue Apr 28, 2017 · 3 comments

Comments

@chijiao
Copy link

chijiao commented Apr 28, 2017

按照文档安装,提示如下错误
[root@localhost wxbot]# node .

/root/wxbot/src/index.js:1
(function (exports, require, module, __filename, __dirname) { let { spawn } =
^
SyntaxError: Unexpected token {
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 Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:945:3

@fritx
Copy link
Owner

fritx commented Apr 29, 2017

@chijiao 你好,

// src/index.js
let { spawn } = require('child_process')

这行貌似用到了"object destructing"这个新语法,根据node.green看,
估计是要node6.4以上才支持,我也不确定。

wxbot最新的这个next分支,
我是基于node7开发的,总是总之尽量用node6/7运行应该就可以了。
推荐使用nvm进行版本管理/切换。

@chijiao
Copy link
Author

chijiao commented Apr 29, 2017

@fritx 感谢回复, 将 nodejs 更新到最新版, 发现如下错误

[root@localhost wxbot]# npm install

[email protected] postinstall /root/wxbot/node_modules/electron
node install.js

module.js:471
throw err;
^

Error: Cannot find module '/root/wxbot/node_modules/electron/install.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:393:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:508:3
[email protected] /root/wxbot
└── [email protected]

npm WARN [email protected] No license field.
npm ERR! Linux 2.6.32-358.el6.x86_64
npm ERR! argv "/usr/local/node-v6.10.2-linux-x64/bin/node" "/usr/local/node-v6.10.2-linux-x64/bin/npm" "install"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/wxbot/npm-debug.log
You have new mail in /var/spool/mail/root

@chijiao
Copy link
Author

chijiao commented Apr 29, 2017

另外解决掉版本及依赖问题以后, 输入 node . , 程序无任何反馈, 也没有任何提示, 请问下一步该如何?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants