然而,又是一对错误:
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/node-gyp',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
所幸,有个提示:
npm ERR! Please try running this command again as root/Administrator.
于是,改成如下的安装命令:
lk@KevinLiu:~/node-v0.10.40-linux-x64/bin$ sudo npm install -g node-gyp
然后,gyp安装成功。
接着去弄SuperScript:
也成功了。
但是在启动的时候,出现了问题:
lk@KevinLiu:~/superscript-editor$ npm start
> superscript-editor@0.1.7 start /home/lk/superscript-editor
> node app
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
Error connecting to the MongoDB -- [Error: failed to connect to [localhost:27017]]
一个是没有安装MongoDB,一个是缺少c++ bson
我怀疑,bson问题和Mongo有关,所以先装好Mongo再说。自动apt-get速度太慢。
细细看,才发现当前目录下没有
/home/lk/package.json这个文件,一搜发现原来在superscript下面,所以切换目录,进入superscript,再start。
lk@KevinLiu:~/superscript-editor$ npm start
> superscript-editor@0.1.7 start /home/lk/superscript-editor
> node app
SuperScript Community Editor.
Listening at />
Bot Name: testbot
Switch or create a new bot by starting `BOT=<name> node app.js`
GET / 200 398.915 ms - -
GET /js/cytoscape.min.js 404 1.833 ms - 32
GET /favicon.ico 404 0.579 ms - 24
null
POST /gambits/quick 200 30.540 ms - 34
POST /gambits/quick 200 266.547 ms - 16
null
GET /topics 200 92.672 ms - -
GET /js/cytoscape.min.js 404 0.755 ms - 32
GET /gambits 200 36.839 ms - -
GET /js/cytoscape.min.js 404 0.726 ms - 32
GET /replies 200 39.346 ms - -
GET /js/cytoscape.min.js 404 0.554 ms - 32
GET /knowledge 200 66.657 ms - -
GET /js/cytoscape.min.js 404 0.546 ms - 32
GET / 200 77.627 ms - -
GET /js/cytoscape.min.js 404 0.654 ms - 32
一切OK。看看我的机器人吧: