Git Product home page Git Product logo

Comments (12)

v-yunbin avatar v-yunbin commented on May 20, 2024 1

@ccoreilly thanks

from vosk-browser.

ccoreilly avatar ccoreilly commented on May 20, 2024

To build the react demo you just need to run npm i && npm run build from within the examples/react folder.

If you don't want to mess with building the library remember to change "vosk-browser": "../../lib" to "vosk-browser": "0.0.5" in examples/react/package.json (before running the npm commands)

from vosk-browser.

ccoreilly avatar ccoreilly commented on May 20, 2024

Let me know if you have any other issues.

from vosk-browser.

v-yunbin avatar v-yunbin commented on May 20, 2024

when I run “npm run build”, I get follows error :

sh: react-scripts: command not found

npm ERR! [email protected] build: react-scripts build

from vosk-browser.

ccoreilly avatar ccoreilly commented on May 20, 2024

Did you run npm install before that?

from vosk-browser.

v-yunbin avatar v-yunbin commented on May 20, 2024

I run “npm i“ ,get follows error:

npm WARN tar ENOENT: no such file or directory, open '/home//vosk-browser/examples/react/node_modules/.staging/webpack-dev-server-912e0be5/client/clients/SockJSClient.js' npm WARN tar ENOENT: no such file or directory, open '/home//vosk-browser/examples/react/node_modules/.staging/webpack-dev-server-912e0be5/lib/servers/SockJSServer.js' npm WARN tar ENOENT: no such file or directory, open '/home//vosk-browser/examples/react/node_modules/.staging/webpack-dev-server-912e0be5/bin/webpack-dev-server.js' npm WARN tar ENOENT: no such file or directory, open '/home//vosk-browser/examples/react/node_modules/.staging/webpack-dev-server-912e0be5/client/clients/WebsocketClient.js' npm WARN tar ENOENT: no such file or directory, open '/home//vosk-browser/examples/react/node_modules/.staging/webpack-dev-server-912e0be5/lib/servers/WebsocketServer.js' npm ERR! Unexpected end of JSON input while parsing near ''

from vosk-browser.

ccoreilly avatar ccoreilly commented on May 20, 2024

This looks like an issue with your setup. Try installing in another location that is not your home folder (you can see in the error log your user name does not appear in the webpack server path)

from vosk-browser.

v-yunbin avatar v-yunbin commented on May 20, 2024

due to the secret , i delete “user name".

I change a registry ,it seems that the command “npm i” pass and get some warning as follows:

npm WARN [email protected] requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of dayjs@^1.8.30 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-sass@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Ignore all this warnings,I run the command "npm run build", get follows errors:

Creating an optimized production build...
Failed to compile.

createRequire is not a function
Referenced from: BaseConfig


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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 2021-11-19T09_59_11_656Z-debug.log

detail errors in 2021-11-19T09_59_11_656Z-debug.log:

10 silly lifecycle [email protected]~build: Args: [ '-c', 'react-scripts build' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `react-scripts build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:961:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/.open_source/vosk-browser/examples/react
16 verbose Linux 3.10.0-1160.36.2.el7.x86_64
17 verbose argv "/usr/local/node/node-v10.9.0-linux-x64/bin/node" "/usr/local/node/node-v10.9.0-linux-x64/bin/npm" "run" "build"
18 verbose node v10.9.0
19 verbose npm  v6.2.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `react-scripts build`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

from vosk-browser.

v-yunbin avatar v-yunbin commented on May 20, 2024

@ccoreilly update the node v16.13.0, it work. whether can I modify the default port 3000?

from vosk-browser.

ccoreilly avatar ccoreilly commented on May 20, 2024

That is the port of the react development server, you should not use that server in production. I think you can change the port via the PORT environment variable.

PORT=8080 npm run start

from vosk-browser.

v-yunbin avatar v-yunbin commented on May 20, 2024

@ccoreilly I get a warning,whether it will affect some usage?

Compiled with warnings.

./node_modules/vosk-browser/dist/vosk.js
Module not found: Can't resolve 'worker_threads' in '/home/ybZhang/.open_source/vosk-browser/examples/react/node_modules/vosk-browser/dist'

from vosk-browser.

ccoreilly avatar ccoreilly commented on May 20, 2024

That's a normal warning of react, no worries

from vosk-browser.

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.