Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to build and get a new demo address? #22

Closed
v-yunbin opened this issue Nov 3, 2021 · 12 comments
Closed

how to build and get a new demo address? #22

v-yunbin opened this issue Nov 3, 2021 · 12 comments

Comments

@v-yunbin
Copy link

v-yunbin commented Nov 3, 2021

how to build and get a new demo address?

@ccoreilly
Copy link
Owner

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)

@ccoreilly
Copy link
Owner

Let me know if you have any other issues.

@v-yunbin
Copy link
Author

v-yunbin commented Nov 19, 2021

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

sh: react-scripts: command not found

npm ERR! vosk-browser-react-demo@0.1.0 build: react-scripts build

@ccoreilly
Copy link
Owner

Did you run npm install before that?

@v-yunbin
Copy link
Author

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 ''

@ccoreilly
Copy link
Owner

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)

@v-yunbin
Copy link
Author

v-yunbin commented Nov 20, 2021

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 jsdom@16.5.0 requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN rc-picker@2.5.7 requires a peer of dayjs@^1.8.30 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@10.1.1 requires a peer of node-sass@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@10.1.1 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@10.1.1 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.4 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.4 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: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: 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! vosk-browser-react-demo@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vosk-browser-react-demo@0.1.0 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 vosk-browser-react-demo@0.1.0~build: Args: [ '-c', 'react-scripts build' ]
11 silly lifecycle vosk-browser-react-demo@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle vosk-browser-react-demo@0.1.0~build: Failed to exec build script
13 verbose stack Error: vosk-browser-react-demo@0.1.0 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 vosk-browser-react-demo@0.1.0
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 vosk-browser-react-demo@0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the vosk-browser-react-demo@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

@v-yunbin
Copy link
Author

v-yunbin commented Nov 23, 2021

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

@ccoreilly
Copy link
Owner

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

@v-yunbin
Copy link
Author

@ccoreilly thanks

@v-yunbin
Copy link
Author

v-yunbin commented Nov 30, 2021

@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'

@ccoreilly
Copy link
Owner

That's a normal warning of react, no worries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants