Comments (13)
Ah, the error is not the module, check the uppercase:
var Artyom = require('artyom.js');
const jarvis = new Artyom();
from artyom.js.
Have you tried just require("artyom.js")
? It should work out of the box requiring only the name of the module.
from artyom.js.
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.
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.
Has anyone solved this?
from artyom.js.
Are you running this in the browser?
from artyom.js.
Hello, I have the same issue :/
I want to use Artyom in a bot for Discord (made with node.js)
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.
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.
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.
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.
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.
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.
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)
- Webview with artyom
- Basic Usage with TS HOT 1
- Remove command Callbacks (TEXT_RECOGNIZED).
- Allow adding custom JSGF
- Speech adaptation
- artyom.say doesn't speak after some time HOT 2
- problem installing node.js HOT 2
- newPrompt returns before receiving a spoken response
- React native HOT 1
- Raspberry artyom HOT 1
- Capturing values with Regex expressions
- .say() and continuos recognition creates a loop
- Voice command
- Very handy tool, looking for progress
- Artyom does not recognize the command HOT 1
- Contentious restarting for no reason.
- Additional languages
- Is there a way for it to only recognise the defined commands?
- Speech Recognition Doesn't work on Safari standalone app on IOS<17
- Regex with wildcard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artyom.js.