mysamai / mysam

An open "intelligent" assistant for the web that can listen to you and learn.
https://mysamai.com
GNU General Public License v3.0
621 stars 65 forks source link

Missing files #11

Closed staminna closed 8 years ago

staminna commented 8 years ago

Hi

I cloned the main repo and tested v0.1.1 but when running mysam, a alert comes up saying

"A Javascript error occured in the main process"

Uncaught Exception: Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/mysam/db-data/actions' at Error (native)

and another one

Uncaught Exception: Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/mysam/db-data/configuration' at Error (native)

Electron window still shows up, but the throbber spins indefinitely.

Thanks. Jorge.

daffl commented 8 years ago

This is probably the same problem as #9. The /usr/local/lib/node_modules/mysam folder needs to be writeable by the user that you start the application with. This won't be the case if you e.g. did sudo npm install mysam -g.

staminna commented 8 years ago

Thank you for quick reply! I thought installing as sudo would make harder for other users to run mysam.

so I did $ sudo npm install mysam -g $ mysam -d

But it didn't seem to install all the dependencies correctly.

I can see Hi. I am Sam...

terminal output: mysam:plugins Not loading plugin module /Users/jorgenunes/.npm-packages/lib +336ms mysam:plugins Not loading plugin module /Users/jorgenunes/.npm-packages/lib/node_modules/feathers +1ms mysam:plugins Not loading plugin module /Users/jorgenunes/.npm-packages/lib/node_modules/hotkeys +1ms mysam:plugins Not loading plugin module /Users/jorgenunes/.npm-packages/lib/node_modules/mysam +0ms mysam:plugins Found plugin mysam-weather +1ms mysam:plugins Setting up /Users/jorgenunes/.npm-packages/lib/node_modules/mysam-weather at /mysam-weather +1ms mysam:plugins Not loading plugin module , +1ms

console: WARN: Could not find feathers in node_modules. Ignoring. npm.js:358 WARN: Could not find socketio in node_modules. Ignoring. npm.js:358 WARN: Could not find hotkeys in node_modules. Ignoring. These packages exist and have Read & Write permissions to all users. They are installed globally and mysam knows they are there

After I type my name and hit Enter: White page with "Cannot GET /?"

This must be because it can't find all required modules.

daffl commented 8 years ago

What I meant is that sudo shouldn't be used to either install or run it. Although, since it seems to load for you now, does it work without -d?

staminna commented 8 years ago

Right, sorry. It sure does run without -d or sudo.

I can't see why is not loading all modules properly, and why is does the weather plugin. It looks like it's a permission issue. Microphone connection is also broken in my environment.

On Sun, 1 Nov 2015 23:01 David Luecke notifications@github.com wrote:

What I meant is that sudo shouldn't be used to either install or run it. Although, since it seems to load for you now, does it work without -d?

— Reply to this email directly or view it on GitHub https://github.com/daffl/mysam/issues/11#issuecomment-152872013.

daffl commented 8 years ago

If the microphone works in your browser it should work with the app as well. You can test it by going to localhost:9090 in your browser while the application is running.

The modules are either a permission or an installation issue. I will test a fresh installation on a VM to make sure the installation isn't busted for development mode and will let you know if it worked.

staminna commented 8 years ago

Hi David.

Yes. The microphone icon flickers toggling on and off very quickly both in browser or Electron but the on the first listening toggle it holds a little longer and I managed to say 'storm'. Hi 'undefined', here is what I can do.. said mySam.

mysam:plugins Not loading plugin module , +0ms mysam:classifier Classifying +3m { input: 'storm' } mysam:classifier { text: 'thank you', tags: [], action: { type: 'reply', reply: 'You\'re welcome' }, _id: 'cLCigspffa2jLeyY', id: '849c829d658baaeff512d766b0db3cce', input: 'storm', classifications:etc..

I did make sure to try chmod -R 777 /Users/../node_modules/ and chown -R myusername /Users/../node_modules/

but that of course didn't work out. perhaps I should I try do this on every directory individually since the root?

Thank you for your help. I am very excited about this.

daffl commented 8 years ago

You'd probably have to run sudo chmod -R 777 /Users/../node_modules/. I'm not sure about your microphone setup but it seems like the browsers don't like working with it. Maybe try going through https://developers.google.com/web/updates/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API?hl=en to find out what is happening with that.

From the log you sent me it now looks like using the -d is working though right?

staminna commented 8 years ago

Yes, - d is working right indeed. Will post as soon I can do it.

Thanks David.

On Mon, 2 Nov 2015 20:03 David Luecke notifications@github.com wrote:

You'd probably have to run sudo chmod -R 777 /Users/../node_modules/. I'm not sure about your microphone setup but it seems like the browsers don't like working with it. Maybe try going through https://developers.google.com/web/updates/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API?hl=en to find out what is happening with that.

From the log you sent me it now looks like using the -d is working though right?

— Reply to this email directly or view it on GitHub https://github.com/daffl/mysam/issues/11#issuecomment-153141378.

staminna commented 8 years ago

The microphone code is correct, I just thought I had to press Control + Space until I would finish the sentence. For some reason, mysam didn't catch my name in the beginning and it's not asking when I load sam. It does reply to hi ,help, shows options and knows the weather.

I have set chmod to 777 from my .npm-packages all the way up. I can't set this on my home directory as I believe it would be a security issue.

daffl commented 8 years ago

Ah yes, that should probably be mentioned in the documentation. Reinstalling should solve your name problem. In your case you could also run rm /usr/local/lib/node_modules/mysam/db-data to clear out the database and then it should ask again.

staminna commented 8 years ago

I have reinstalled without sudo, but the feathers, issue and socket.io still says WARN: Could not find feathers in node_modules. Ignoring. Perhaps that's why it's not catching my name

Hi undefined! Here is what I can do:

Say hi Make a reply Show the help Call myplugin Tell you the weather

Object {input: "George", text: "thank you", tags: Array[0], action: Object, _id: "wkdoUR6uXcgtN5j2"…} can.js:262 Info: Model.js - Map created

daffl commented 8 years ago

No, that error has nothing to do with your problem. If you look at the training data at https://github.com/daffl/mysam-frontend/blob/master/lib/trainings.json#L85 you will see that it expects something along the lines of

"My name is..."

or

"I'm ...".

I think we can close this issue and maybe you can create a new one to also try to fill in the name if the sentence is just a single word and not to save it when the name is empty? By the way, you can also type your name into the grey input field.