Bottr-js / Bottr

🤖 The world's simplest framework for creating Bots
http://bottr.co
MIT License
936 stars 86 forks source link

pozi install error #40

Closed skorotkiewicz closed 7 years ago

skorotkiewicz commented 7 years ago

I get this error on raspberry pi 3 with rasbian

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN your-bot@1.0.0 No description
npm WARN your-bot@1.0.0 No repository field.
jcampbell05 commented 7 years ago

What commands did you run, what operating system and can you share your package.json

skorotkiewicz commented 7 years ago
mod@raspberrypi:~/botcli $ cat package.json
{
  "name": "your-bot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "bottr": "^0.1.0",
    "bottr-app": "^0.2.0"
  },
  "scripts": {
    "start": "bottr-cli start"
  },
  "author": "",
  "license": "ISC"
}
jcampbell05 commented 7 years ago

I see you are running this on a raspberry pi, what operating system is it running ?

skorotkiewicz commented 7 years ago

I run this on rasbian..

I try to add --no-optional command, but nothing

mod@raspberrypi:~/botcli $ npm install --no-optional pozi
npm WARN deprecated pozi@1.0.0: Package abandoned, contact support@npmjs.com for more info.
your-bot@1.0.0 /home/mod/botcli
└── pozi@1.0.0

npm WARN your-bot@1.0.0 No description
npm WARN your-bot@1.0.0 No repository field.
jcampbell05 commented 7 years ago

@modInfo Where did you find those instructions ? We've renamed the package bottr-cli

skorotkiewicz commented 7 years ago

Nothing.

mod@raspberrypi:~/botcli $ npm install bottr-cli
your-bot@1.0.0 /home/mod/botcli
└── bottr-cli@0.1.2

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN your-bot@1.0.0 No description
npm WARN your-bot@1.0.0 No repository field.
vutran commented 7 years ago

Your start script should node index.js.

skorotkiewicz commented 7 years ago

@vutran Dosent work without modules..

mod@raspberrypi:~/botcli $ node index.js
module.js:457
    throw err;
    ^

Error: Cannot find module 'pozi'
[...]
mod@raspberrypi:~/botcli $ node index.js
module.js:457
    throw err;
    ^

Error: Cannot find module 'botter-cli'
vutran commented 7 years ago

Do you have a link to the code? You don't need bottr-cli to run a bot. That is used to create a bot.

pavs commented 7 years ago

Having same issue, Followed the documentation.

~/Desktop/bot: sudo npm install -g pozi
Password:
npm WARN deprecated pozi@1.0.0: Package abandoned, contact support@npmjs.com for more info.
/usr/local/lib
└── pozi@1.0.0

~/Desktop/bot: bottr-cli start
Server is running on http://localhost:3000
module.js:457
    throw err;
    ^

Error: Cannot find module 'pozi'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/pavs/Desktop/bot/index.js:1:75)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

~/Desktop/bot: cat index.js
var Bottr = require('pozi');
var bot = new Bottr.Bot();

bot.on('message_received', function(message, session) {
  session.send('Hello World')
})

bot.listen();
vutran commented 7 years ago

Why is it requiring pozi? Can you try changing that to bottr?

pavs commented 7 years ago

I used the sample code from doc, changing it to bottr, fixed it. Can you place update your doc to reflect it?

I get this error now:

~/Desktop/bot: bottr-cli start
Server is running on http://localhost:3000
Tue, 18 Oct 2016 01:00:49 GMT body-parser deprecated undefined extended: provide extended option at node_modules/bottr/lib/bot.js:36:30

going to http://localhost:3000 gives this error:

Cannot GET /
vutran commented 7 years ago

Hi @pavs, thanks for the suggestion. I've updated the guide here.

It looks like you are missing the bottr-app module. This module is a simple chat app that allows you to connect to the bot.

$ npm install --save bottr-app

Once installed, you can apply a new instance of bottr-app into the bot.

const BottrApp = require('bottr-app');

bot.use(new BottrApp());

As for documentations, we're currently working to improve upon the documentations (#11) to provide a better experience for everyone to get their first bot up and running. Please feel free to contribute towards the docs as we're open to contributions on all levels.