Category Archives: Error

When starting Vue project: cannot find module ‘webpack cli / bin / config yargs’ error resolution

An error is reported when starting Vue project: cannot find module ‘webpack cli/bin/config yargs’, as shown in the following figure:

the reason for this error is that the version of webpack and webpack dev server is incompatible. The solution is as follows:

Under this vue project, type:
npm uninstall webpack -g
npm uninstall -g webpack-dev-server
Uninstall and reinstall:
npm install [email protected] --save-dev
npm install [email protected] --save-dev

Restart the project, success!

Error:scalac: missing or invalid dependency detected while loading class file ***

An error occurs when developing spark application, as shown in the figure,

This mistake bothered me for two days, but I generally knew it was the problem of dependency.

First of all, I reemport pom.xml , and still report an error. Adding reimport after deleting dependency is also an error. This step is basically ruled out pom.xml It’s a matter of time.

After that, I suspected that the package downloaded to the local was damaged. I went to the local Maven warehouse to check, deleted all the files in the Maven warehouse, let Maven download again, and still reported an error. Here, we exclude the damage of the local package. Maybe there is something wrong with the download.

Then, I opened the local Maven warehouse and found a file with suffix. Lastupdated in the relevant package. The jar package was not downloaded successfully. I tried to manually download the corresponding jar package and add it, but still reported an error. But the reason for the error is basically locked, which is the problem of downloading!

Finally, I reconfigured Maven’s setting.xml File, and repeat the first two steps, reload dependency, no error after running again, the problem is solved

In a word, if you encounter problems about dependency, you can basically solve them step by step according to the previous ideas. If you encounter problems, don’t be afraid. If you analyze them step by step according to the problems and feedback, you can certainly solve them.

Firefox: How to Solve Syntax error: invalid regexp group

Error details:

Found that Google and 360 browsers work fine, but on Firefox it reports an error: SyntaxError: invalid regexp group

The reason for the error: my regularization is useful – —?& lt=

eg.(?<=(?:TianYe))[\u4e00-\u9fa5]{2}     	------  Regular match for 2 Chinese characters starting with (TianYe) and ending with (TianYe).
// (? <=(? :TianYe)) ------ matches strings starting with (TianYe) and is not captured (not stored) in the group;
// [\u4e00-\u9fa5] ------ matches Chinese characters;
// {2} ------- matches 2 characters.

Root cause:

Firefox does not support prior assertion(lookahead) 

Solutions:

Match it first, and then slice(0,2) it later.

Vue Report Error #NULL! :no such file or directory,chmod….. [email protected] **\css- Beautify.js

Vue – error when using Vue cli/webpack to build project cnpm install dependency: 0 Error:ENOENT :no such file or directory,chmod..... [email protected] \**\css- beautify.js

cannot find module 'opn'/async-each/anymatch

As shown in the figure:

There are not many related solutions on the Internet. By searching stackoverflow, it is determined that it is a bug after JS beauty upgrade 1.7.0. At the beginning of the idea is to install the old version of 1.6, also tried to 1.7node_ To replace the relevant files in the modules folder can only solve the practical problem, NPM run dev </ code> continues to report errors as follows:

Unfortunately, one by one module was installed. Because the secondary dependency of plug-ins was suspended, the installation failed. There are too many modules


The final solution is as follows:

1. Modification package.json

//Clear all the dependencies from 替换为[email protected]版本, then cnpm install for dependency installation

2. Install version 1.6.14

//Local installation of version 1.6.14
//cnpm install [email protected]
//At this point, there are two versions of node_modules js-beautify.js

3. Replace dependent files

//The error is that the css-beautify.js file is not found, and if you open the directory you can see that even the lib directory is missing

/// At this point, open node_modules/[email protected]@js-beautify/js and copy all the files in that directory (except index.js),

/// then open node_modules/[email protected]@js-beautify/js and paste all the copied files into it

At this time, the required files for version 1.7.0 already exist:

4. Installation dependency

//js-beautifyThe problem is solved at this point and will no longer affect the installation of the secondary dependencies of the later plugins

// Undo the changes to package.json, thecnpm install

5. Enter the development stage

//npm run dev,done

Uiautomatorviewer Error: Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT…

1.Error report screenshot

After Android 8, the UI Automator of the SDK is opened directly, and the machine interface information cannot be intercepted.

It is recommended that you can use the following methods to intercept manually

2.Solutions

1. Intercept the uix file

adb shell uiautomator dump /sdcard/ sc.uix

adb pull /sdcard/ sc.uix

Note: the new mobile address is changed to/data/local/TMP/*. Uix

2. Screenshot

adb shell screencap -p /sdcard/ sc.png

adb pull /sdcard/ sc.png

3. Open the uiautomatorviewer.bat , import the screenshot and resource file obtained from the machine

3、 Screenshot after solution

Eclipse Tomcat Error creating bean with name ‘sqlSessionFactory’ defined in URL…

[operation environment]

jdk1.8+eclipse+apache tomcat v7.0

 

[phenomenon]

Code running error org.apache.catelina . core.StandardContext listenerStart

Error creating bean with name ‘sqlSessionFactory’ defined in URL [file:/E:/apache-tomcat-7.0.63-windows-x64

 

Tomcat error

 

Reason: no Tomcat jar package added

Select the project, right-click, select build path — & gt; add Libraries… — & gt; select server runtime — & gt; next — & gt; select Apache Tomcat v7.0 — & gt; OK.

 

 

 

 

 

TypeException: Error setting non null for parameter #1 with JdbcType null

Insert the expiration date into mysql. The error is:

Login exception is org.apache.ibatis . type.TypeException : Could not set parameters for mapping: ParameterMapping{property=’expired’, mode=IN, javaType=class java.util.Date , jdbcType=null, numericScale=null, resultMapId=’null’, jdbcTypeName=’null’, expression=’null’}. Cause: org.apache.ibatis . type.TypeException : Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException : Parameter index out of range (1 > number of parameters, which is 0).

I always thought that the MySQL insert date required format. After traversing various methods, I saw a blog and found that it was a problem with my own insert statement…

@Insert({"insert into ", TABLE_NAME, "(", INSERT_FIELDS,") values (#userId}, #{expired}, #{status}, #{ticket})" })

There is one missing userid{

Right for

@Insert({"insert into ", TABLE_NAME, "(", INSERT_FIELDS,") values (#{userId}, #{expired}, #{status}, #{ticket})" })

Taikeng, record it

Git Push Error: failed to push some refs to ‘[email protected]:

git push error: failed to push some refs to ‘[email protected]:

$ git push -u origin master
To [email protected]:xxx/xxx.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:xxx/xxx.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Reason:
in GitHub remote warehouse README.md The file is not in the local warehouse.
solutions:

$ git pull --rebase origin master
$ git push -u origin master

Eureka unit test error creating bean with name ‘Eureka autoservice registration’: Singleton bean

 If you encounter the following error message during unit testing, there are two ways to resolve it
 org.springframework.beans.factory.BeanCreationNotAllowedException:
 Error creating bean with name 'eurekaAutoServiceRegistration': Singleton bean...

Method 1: add notes

Add the following annotation to the unit test class (rest assured that there will be no local reference, but it cannot be deleted)

@MockBean
private EurekaAutoServiceRegistration eurekaAutoServiceRegistration;

Method 2: implement the beanfactory postprocessor interface

@Component
public class FeignBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        BeanDefinition bd = beanFactory.getBeanDefinition("feignContext");
        bd.setDependsOn("eurekaServiceRegistry", "inetUtils");
    }
}

Python3: Str.format Keyerror Solution for incoming parameter error

Python3 str.format Keyerror solution for incoming parameter error

Additional knowledge of keyerror description and solution

Keyerror description and solution

If the parameter is called in the way of ‘W’, keyerror will be generated

# Define the variable c
>>>c = {'w':'w', 'o': 'o', 'r': 'r', 'l': 'l', 'd': 'd'}
{'w':'w', 'o': 'o', 'r': 'r', 'l': 'l', 'd': 'd'}
# Calling the parameter with 'w' will generate a KeyError error
>>>"Hello, {'w'}{'o'}{'r'}{'l'}{'d'}!".format(**c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'w'

Solution:

# Remove the single quotes and it'll be fine
>>> "Hello, {o}{r}{l}{d}!".format(**c)
Hello, world!

But I don’t understand the principle, I need to continue to learn.

Supplementary knowledge

When dict() is called to generate a dictionary, the key reference does not need to add single quotation marks.

>>>dict(w='w', o='o', r='r')
{'w': 'w', 'o': 'o', 'r': 'r'}

Spark-SQL Error: A JNI error has occurred, please check your installation and try again Exceptio

Error: a JNI error has occurred, please check your installation and try again
exception in thread “main” java.lang.NoClassDefFoundError : org/slf4j/Logger

Solution:
the command line can temporarily import the following variable, or configure it to the environment variable.

	#Add the Hadoop classpath to SPARK_DIST_CLASSPAHT
export SPARK_DIST_CLASSPATH=$(hadoop classpath)