GithubHelp home page GithubHelp logo

Artyom with express about artyom.js HOT 13 OPEN

4bull avatar 4bull commented on May 16, 2024
Artyom with express

from artyom.js.

Comments (13)

sdkcarlos avatar sdkcarlos commented on May 16, 2024 1

Ah, the error is not the module, check the uppercase:

var Artyom = require('artyom.js');

const jarvis = new Artyom();

from artyom.js.

sdkcarlos avatar sdkcarlos commented on May 16, 2024

Have you tried just require("artyom.js") ? It should work out of the box requiring only the name of the module.

from artyom.js.

4bull avatar 4bull commented on May 16, 2024

of course but no chance, doesn't work with only artyom.js, is for that I have tried with full path.
Others module works out of the box.

Any others idea?

from artyom.js.

4bull avatar 4bull commented on May 16, 2024

yes, I found this typo error me too. Thanks
but it doesn't work anyway.... I got

const jarvis = new Artyom();
               ^

TypeError: Artyom is not a constructor

from artyom.js.

mamihelj09 avatar mamihelj09 commented on May 16, 2024

Has anyone solved this?

from artyom.js.

webleyson avatar webleyson commented on May 16, 2024

Are you running this in the browser?

from artyom.js.

alineo avatar alineo commented on May 16, 2024

Hello, I have the same issue :/
I want to use Artyom in a bot for Discord (made with node.js)

link imgur

const Artyom = require("artyom.js");
const artyom = new Artyom();

const artyom = new Artyom();
TypeError: Artyom is not a constructor

Does someone know what it is or what to do ?
Thanks

from artyom.js.

DigitalFlux avatar DigitalFlux commented on May 16, 2024

I ran into this issue recently in working with this after doing npm install on nodejs, and found that changing:
exports.default = Artyom;
to:
exports.Artyom = Artyom;
At the end of build/artyom.js allowed me to do the following:
var Artyom = require('./node_modules/artyom.js/build/artyom.js').Artyom; this.voice = new Artyom();

this being a class that assigns the new Artyom object to its voice member. I'm able to start it up, and now I'm just going through trying to get it to recognize any voice inputs (which may be a different issue than something inside Artyom, since I'm experimenting with node inside Electron right now).

If that issue has to do with Artyom, I'll update..

from artyom.js.

rodrigooler avatar rodrigooler commented on May 16, 2024

same problem with electron :/

$ electron .
App threw an error during load
TypeError: Artyom is not a constructor
    at Object.<anonymous> (/Users/rodrigooler/proje
cts/friday/with-electron-app/main/index.js:7:16)
    at Object.<anonymous> (/Users/rodrigooler/proje
cts/friday/with-electron-app/main/index.js:49:3)
    at Module._compile (module.js:642:30)
    at Object.Module._extensions..js (module.js:653
:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at loadApplicationPackage (/Users/rodrigooler/p
rojects/friday/with-electron-app/node_modules/elect
ron/dist/Electron.app/Contents/Resources/default_ap
p.asar/main.js:287:12)
    at Object.<anonymous> (/Users/rodrigooler/proje
cts/friday/with-electron-app/node_modules/electron/
dist/Electron.app/Contents/Resources/default_app.as
ar/main.js:328:5)
    at Object.<anonymous> (/Users/rodrigooler/proje
cts/friday/with-electron-app/node_modules/electron/
dist/Electron.app/Contents/Resources/default_app.as
ar/main.js:365:3)

from artyom.js.

DigitalFlux avatar DigitalFlux commented on May 16, 2024

Yeah, don't bother. Found that NWJS (and Electron, I believe) does not support voice recognition because Google pulled it from Chromium in order to get devs to use the cloud API. However, you can still do it through the browser, and what I wound up doing for my purposes was to pop a tab in Chrome with Artyom doing the voice recognition and an HTML "please don't close because XXX" blurb while routing the voice commands to NWJS via IPC. Works for now- would be nicer if Google put that bit back into Chromium instead of trying to force a cloud routing of voice data. But yeah, never got it to work on NodeJS as such.

from artyom.js.

rodrigooler avatar rodrigooler commented on May 16, 2024

@DigitalFlux

I ran into this issue recently in working with this after doing npm install on nodejs, and found that changing:
exports.default = Artyom;
to:
exports.Artyom = Artyom;
At the end of build/artyom.js allowed me to do the following:
var Artyom = require('./node_modules/artyom.js/build/artyom.js').Artyom; this.voice = new Artyom();

this being a class that assigns the new Artyom object to its voice member. I'm able to start it up, and now I'm just going through trying to get it to recognize any voice inputs (which may be a different issue than something inside Artyom, since I'm experimenting with node inside Electron right now).

If that issue has to do with Artyom, I'll update..

In case I just managed to make it work because of your comment above to adjust the export unfortunately it is not working in the current version. I was able to make parts work on electron but I need to solve the window problem. I'll put the solution here if I can. I have not gotten into the problem you said yet, but it can be an unfortunate problem.

from artyom.js.

amreen-rajmohmad avatar amreen-rajmohmad commented on May 16, 2024

Same here. I also tried the solution mentioned above about changing default export.
following is the error i get :
`(base) LT6564:node-server-tutorial amreen.rajmohmad$ node server.js
/Users/amreen.rajmohmad/Documents/node-server-tutorial/node_modules/artyom.js/build/artyom.js:59
if (window.hasOwnProperty('speechSynthesis')) {
^

ReferenceError: window is not defined
at new Artyom (/Users/amreen.rajmohmad/Documents/node-server-tutorial/node_modules/artyom.js/build/artyom.js:59:13)
at Object. (/Users/amreen.rajmohmad/Documents/node-server-tutorial/server.js:11:16)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)`

from artyom.js.

amreen-rajmohmad avatar amreen-rajmohmad commented on May 16, 2024

Okay, So how i resolved this is :

const Artyom = require('artyom.js').default;
since I was facing a windows error as I mentioned in my previous comment
I saw there was already a PR addressing it.

https://github.com/sdkcarlos/artyom.js/pull/98/files

I replaced my Artyom.js file with these updated changes.

Then to make sure that node_modules use this changes : run following command from your package. it will create patches folder.

npx patch-package <package name>
and add the following flag in your package.json so that on npm install this patch is applied again.

"postinstall": "npx patch-package"

https://stackoverflow.com/questions/13300137/how-to-edit-a-node-module-installed-via-npm

from artyom.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.