Category Archives: How to Fix

Vscode error: error: read etimedout

 

 

Recently, I was working on a “body test” project of the company. When I started ide vscode, I reported an error as follows:

 

 

Error: read ETIMEDOUT 
   at _ errnoException ( util.js:1022 :11) 
   at TLSWrap.onread ( net.js:628 :25)

 

 

And this:

 

 

 

Then I went to the Internet to find a solution, and found the following solution (it didn’t solve my problem, but it’s a good method. Maybe it can solve your problem, so I stuck it. Here’s an explanation)

 

 

Now I’ll talk about the specific commands that need to be executed under the terminal

1. Install cli proxy plugin

npm install -g @ionic/cli-plugin-proxy

2. Configure proxy

export HTTP_PROXY="http://127.0.0.1:51481" # also used by npm
export HTTPS_PROXY="https://127.0.0.1:51481" # also used by npm
export IONIC_HTTP_PROXY="http://127.0.0.1:51481"

Among them, 127.0.0.1:51481 is my own agent

3. Install ionic template

After successfully performing the above two steps, we can download the ionic template

ionic start ionicProject blank

 

 

This is a solution found on the Internet. The way to solve my problem is to set the firewall to stop blocking“ node.js ”It's very simple. Ha ha.

 

There are two solutions in total. If you encounter this problem, I suggest you take a look at the firewall first. If you are not sure, you can use the above method, which should be able to solve the problem. If not, then I can't help it. I can only continue to look for other solutions on the Internet.

 

 

 

WeChat official account: "meet Wang Chuan"

Programming, financial management, English, welcome to play with me.

 

 

 

Java command line uses a JNI error has occurred, please check your installation and try again

Error: a JNI error has occurred, please check your installation and try again
exception in thread “main” java.lang.UnsupportedClassVersionError : Demo has been compiled by a more recent version of the Java Runtime (class file version 55.0), This version of the Java runtime only recognizes class file versions up to 52.0

solution:
jre8u164 was installed once before in the system, and jdk11.0.2 was installed without uninstalling. It is estimated that there is a conflict. Just delete jre8u164.

Extended content

For the concepts and differences of JDK, JRE, Java se, Java EE and java me, please refer to https://www.cnblogs.com/In-order-to-tomorrow/p/3652315.html

Syntax error: invalid syntax before Python string

The usage of adding f before Python string

 

import time
t0 = time.time ()
time.sleep (1)
name = ‘processing’

#Starting with {f} indicates that Python expressions in braces are supported in strings
Print (f ‘{name} done in{ time.time () – t0:.2f} s’) 

Output:
processing done in 1.00 s

 

Why report a mistake

This usage is only used after 3.6. Mine is Python 3.5, which is so direct and simple

resolvent

What’s the way?Of course, it’s anaconda

Android studio reported an error, Error:SSL peer shut down incorrectly

When we import projects with Android studio, we often encounter all kinds of errors, resulting in the project not running.

Recently, I have encountered a problem. What’s wrong Error:SSL peer shut down incorrectly

After checking, it seems that we have to change various configuration files, which is very troublesome.

I took a look at it right here

Compare with the local project that can be compiled normally, change the parameters.

Then it’s ready to run.

Shell script execution error: “syntax error near unexpected token”

Shell script execution error: “syntax error near unexpected token”

Step 1: execute VI – B test.sh Step 2: replace: Shift +: Colon & gt; enter: S/^ m// g

Today, I wrote a shell script (which was written on windows and moved to Linux). When it was executed, I always reported the following error:

at first, I thought it was a script syntax problem, and I couldn’t execute it. Then I changed it to the simplest one. Later, I searched the Internet for it. It was not a script syntax problem, but a coding problem. There are two steps to solve the problem

Step 1: execute VI – B test.sh

test.sh Is the script to execute

Step 2: replace: Shift +: Colon & gt; enter: S/^ m// g

In the last line mode:
Input: % s/^ m// g
^ m is not "^" plus "m", but generated by "Ctrl + V" and "Ctrl + m".

The original reference is as follows:
transferred from: https://blog.csdn.net/xyp84/article/details/4435899

long long ago… Old teletypewriters used two characters to start a new line. One character moves the carriage back to the first position (called carriage return, ASCII code 0d), and the other character moves one line on the paper (called line feed, ASCII code 0A). When computers came out, memory used to be very expensive. Some people don't think it's necessary to use two characters at the end of a line. UNIX developers decided that they could use a single character to indicate the end of a line. Linux follows UNIX, too. Apple developers have defined the use of. The guys who developed MS-DOS and windows decided to use the old-fashioned.
Because MS-DOS and windows use carriage return + line feed to indicate line feed, you can use VIM under Linux to view the code written in VC under windows, and the "^ m" symbol at the end of the line.

To solve this problem in VIM is very simple. You can kill all "^ m" by using the replacement function in vim. Type the following replacement command line:

1)vi -b setup.sh

2) On the command line & lt; press ESC, and then shift +: Colon & gt; enter% s/^ m// g

Note: the ^ m character in the above command line is not "^" plus "m", but generated by "Ctrl + V" and "Ctrl + m" keys.

After this replacement, the save can be executed. Of course, there are other alternatives, such as:

a. Some Linux versions have dos2unix programs that can be used to remove ^ M.

b. Cat filename1 | tr - D "/ R" & gt; newfile removes ^ m to generate a new file, as well as sed command. All replaceable commands can be used to generate a new file.

As mentioned above, deleting the ^ mshell script will run normally. Later, I asked my colleague that he had modified the program path in his Windows Notepad, resulting in an extra ^ m in each line.

Error in installing virtualenv

1、ERROR: Cannot uninstall ‘xxx’. It is a distutils installed project and thus we cannot accurate

find '.' -name "*filelock*.egg-info" -exec rm -rf {} \;

source https://blog.csdn.net/j___ t/article/details/96052936

2、v irtualenv:error :unrecognized arguments: –no-site-packages

–No site packages does not have this parameter, which is a problem with the version of virtualenv

pip3 install --upgrade virtualenv==16.7.9

 

Unexpected syntax error: unexpected token<

The Vue project encountered an error when running, as shown in the following figure:

after clicking on it, the following prompt appears:

it may be that there is an error in the reference of the resource path, such as vue.config.js In the configuration, the public path is “.”/”, while the browser is http://192.168.1.12 : 8080/test/#/to access the project in this way, there is an additional secondary directory /Test /, resulting in the resource cannot be found.

method 1: put vue.config.js In the configuration, publicpath: ‘/’

method 2: remove the secondary directory http://192.168.1.12 :8080/#/

[MySQL] error 1396 (HY000): Operation create user failed for ‘MySQL’ @’localhost ‘

Error 1396 (HY000): Operation create user failed for ‘MySQL’ @’localhost ‘

reason:

Delete MySQL users directly use delete from mysql.user where user like ‘%mysql%’;

Then create MySQL again and report the user’s error;

solve:

Check to see if there is this user

mysql> select distinct user from mysql.user;
+-------+
| user  |
+-------+
| root  |
+-------+
1 rows in set (0.00 sec)

Using drop to delete users

mysql> drop user 'mysql'@'localhost';

After deleting, you can re create the user. If you report the same error, you may encounter a MySQL bug and need to refresh the permissions

mysql> flush privileges;

Then recreate the user

mysql> create user 'mysql'@'localhost' identified by 'mysql';