Tag Archives: node.js

Video player plays flv with error flv: Unsupported audio codec IDX: 7

1、 Detailed error reporting information is as follows:

[TransmuxingController] > DemuxException: type = CodecUnsupported, info = Flv: Unsupported audio codec idx: 7
Uncaught (in promise) Error: Unhandled error. (undefined)
    at EventEmitter.emit (events.js:135)
    at EventEmitter.eval (flv-player.js:453)
    at EventEmitter.emit (events.js:144)
    at eval (transmuxer.js:729)

Flv: Unsupported audio codec.

2、 Solution

Analysis: there is no error in the front end
reason: Google does not prohibit video, but audio, but the video contains audio information, so it depends on whether the playback stream contains audio operations

Here, modify the streaming command to solve the problem:
Original:

ffmpeg -i rtsppath -vcodec copy -s 704x576 -acodec copy -f flv rtmp:/****/rtmplive/test

After modification:

ffmpeg -i rtsppath -vcodec copy -an -s 704x576 -acodec copy -f flv rtmp:/****/rtmplive/test

3、 Summary

when ffmpeg streaming is used, the audio coding is forced to AAC format.

Vue install reports an error operation not allowed

Solution:

1. Permission problem
you can run CMD as an administrator or open CMD by pressing Win + x .

2. Dependency package error
generally, in this case, we need to focus on the directory after operation not allowed . Through the error prompt, the problem can be solved by correctly installing the required dependent packages globally.

3. NPM version problem
this is also similar to the previous one, because different versions sometimes have problems with dependent packages. For example, the version is too high and there is no corresponding dependent package, so it is OK to change the NPM version.

error cb() never called! error This is an error with npm itself

Various methods have been tried on the Internet, but they haven’t been solved. Finally, the latest version of nodejs is installed manually and normal (you can directly overwrite and install it to the original path)

Attached information:
gnvm is a simple node.js multi version manager under windows, similar to NVM nvmw nodist
https://github.com/Kenshin/gnvm

NPM replace with a different version

#npm install -g npm@version
npm install -g [email protected]

Nodejs comes with NPM

[Solved] Wepy build watch Error: ERR! Parse WePY config failed. Are you trying to use

The specific error is
[22:54:56] err! Parse WePY config failed. Are you trying to use WePY 2 to build WePY 1 project?
[22:54:56] ERR! Unexpected type: plugins expect a Array

This is because
the version of wepy used in the current project is 1. X, while the version of wepy on the computer is 2, X

NPM install wepy cli – G command installs version 1. X
NPM install @wepy cli – G command installs version 2. X
the difference is@

Solution:

Locate C:\users\XX\appdata\roaming\NPM\node_Modules folder
delete the @wepy folder, and then execute NPM install wepy cli – G

How to Solve Nodejs error: cannot find module ‘. /application’

Open the terminal and enter nodemon./index.js. The following error messages appear:

Solution:

After entering the directory where index.js is located
delete node_ Module folder and package lock.json file open the terminal, type NPM clean cache , clear the cache, type NPM I , and type nodemon index. JS  for installation dependency
Run nodemon./index.js again

Perfect solution~

Error when Python executes JavaScript statement

‘gbk’ codec can’t encode character ‘\u20ac’ in position 62114: illegal multibyte sequence
find this line in the JS files:

e = "a€|",

It should be this symbol that reports an error. How to solve it

with open('./encryp_js/eventid_encryp.js', 'r', encoding='utf-8') as f:
    content = f.read()
jsdata = execjs.compile(content)

[Solved] Error: ER_HOST_NOT_PRIVILEGED: Host ‘x.x.x.x‘ is not allowed to connect to this MySQL server

Problem Description:

Use nodejs to connect to the MySQL database of ECs and execute the JS file. The error is as follows:

Error: ER_HOST_NOT_PRIVILEGED: Host 'x.x.x.x' is not allowed to connect to this MySQL server
{
  code: 'ER_HOST_NOT_PRIVILEGED',
  errno: 1130,
  sqlMessage: "Host 'x.x.x.x' is not allowed to connect to this MySQL server",
  sqlState: undefined,
  fatal: true
}

Solution:

This is caused by MySQL configuration that does not support remote connection. You need to connect to the server for the following configuration (log in to the root account):

mysql -u root -p
use mysql;
select host from user where user='root';
update user set host = '%' where user ='root';
// If Host = '%', it means that all IPs have connection privileges, which should be set according to the IPs of the production environment
flush privileges;

[Solved] internal/modules/cjs/loader.js:892 ^Error: Cannot find module ‘C:\Users\LX\Desktop\Node_DEMO\a

When I first started learning node.js, I reported an error at the beginning and my mentality collapsed

———————————————————————————–

I create a folder node on my desktop_ Demo, my xx.js file is in node_ demo> demo2> app.js

In vscode, I directly Ctrl + ` (backquote) to open the terminal, but the following error occurs

Look at the path carefully and find that it is wrong. My app.js should be in demo2. Maybe this shortcut does not open the target file….

Therefore, click JS file in the left directory, right-click and select open to open it in the integration terminal~~

Successful problem solving is tiring~~~~

Error command failed when creating vue-cli4 project: Yarn

Error reported when creating Vue item: error command failed: Yarn

Solution 1: Win + R enter CMD to enter the command line interface

Enter command

npm install -g yarn

After success, the problem can be solved by re creating vue-cli4 project.

Solution 2:

Enter C:/users/administrator/in the windows environment

There is a file. Vuerc

 

Open this file to display

{
  "useTaobaoRegistry": true,
  "packageManager": "yarn"
}

Just manually change the configuration content yarn to NPM to change the package manager when the project is created

Solution 3:

Delete the. Vuerc file. When you create a Vue project for the first time, you will be prompted to select the configuration, and then select NPM
 

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit

@[TOC](Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93))

Importing other people’s Vue projects on gitee or GitHub can easily lead to incompatible node sass versions. Generally, you are prompted as follows:

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.12.0

This is the error encountered

We open the web page on the link and find that it is the corresponding version. My node version is 16, which is incompatible

Here, you need to change the version of node sass in package.json to match the notejs Version (emphasis)

On the official website, you can see that my nodejs (16) corresponds to 6.0+

After modification, it is better to delete the previous node sass Version (under the node_medules directory)

Re execute NPM I or cnpm I to re import dependencies

Done!!!