superscriptjs / superscript

A dialogue engine for creating chat bots
http://superscriptjs.com
MIT License
1.65k stars 209 forks source link

Error: ENOENT: no such file or directory, open './data.json' #397

Closed monk1337 closed 6 years ago

monk1337 commented 6 years ago

I am trying to run the project ,

I have installed npm , node and mango but i am keep getting this error :

MacBook-Air:myBotName exepaul$ npm run start-telnet

> myBotName@0.0.0 start-telnet /Users/exepaul/myBotName
> npm run build && node lib/server-telnet.js

> myBotName@0.0.0 build /Users/exepaul/myBotName
> babel src --presets babel-preset-es2015 --out-dir lib

src/server-slack.js -> lib/server-slack.js
src/server-telnet.js -> lib/server-telnet.js
{ Error: ENOENT: no such file or directory, open './data.json'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: './data.json' }
undefined:1
undefined
^

SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at ReadFileContext._fs2.default.readFile [as callback] (/Users/exepaul/myBotName/node_modules/superscript/lib/bot/db/import.js:233:40)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myBotName@0.0.0 start-telnet: `npm run build && node lib/server-telnet.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the myBotName@0.0.0 start-telnet script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/exepaul/.npm/_logs/2017-12-30T07_57_09_553Z-debug.log

2017-12-30T07_57_09_553Z-debug.log log file says :

MacBook-Air:_logs exepaul$ vim 2017-12-30T07_57_09_553Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'start-telnet' ]
2 info using npm@5.3.0
3 info using node@v8.2.1
4 verbose run-script [ 'prestart-telnet', 'start-telnet', 'poststart-telnet' ]
5 info lifecycle myBotName@0.0.0~prestart-telnet: myBotName@0.0.0
6 info lifecycle myBotName@0.0.0~start-telnet: myBotName@0.0.0
7 verbose lifecycle myBotName@0.0.0~start-telnet: unsafe-perm in lifecycle true
8 verbose lifecycle myBotName@0.0.0~start-telnet: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/exepaul/myBotName/node_modules/.bin:/anaconda/bin://anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin:/Users/exepaul/Downloads/chromedriver:/usr/local/MacGPG2/bin
9 verbose lifecycle myBotName@0.0.0~start-telnet: CWD: /Users/exepaul/myBotName
10 silly lifecycle myBotName@0.0.0~start-telnet: Args: [ '-c', 'npm run build && node lib/server-telnet.js' ]
11 silly lifecycle myBotName@0.0.0~start-telnet: Returned: code: 1  signal: null
12 info lifecycle myBotName@0.0.0~start-telnet: Failed to exec start-telnet script
13 verbose stack Error: myBotName@0.0.0 start-telnet: `npm run build && node lib/server-telnet.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:921:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid myBotName@0.0.0
15 verbose cwd /Users/exepaul/myBotName
16 verbose Darwin 16.5.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start-telnet"
18 verbose node v8.2.1
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error myBotName@0.0.0 start-telnet: `npm run build && node lib/server-telnet.js`
22 error Exit status 1
23 error Failed at the myBotName@0.0.0 start-telnet script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
"2017-12-30T07_57_09_553Z-debug.log" 39L, 2578C
dishuostec commented 6 years ago

Are you run npm run parse before start service? This will parse all *.ss file in ./chat dir and save data to ./data.json.