Introduce wangeditor5 to run an error: You may need an appropriate loader to handle this file type (es6 compatibility issue)

wangeditor5 Import and Run Error: You may need an appropriate loader to handle this file type (es6 compatibility issues)

Recently upgraded the rich text wangeditor used, I upgraded to the latest version of wangeditor5
Introduced wangeditor5 into the vue project, Starting the project has been reporting errors

You may need an appropriate loader to handle this file type 

At first, I tried many methods but failed to solve it, Later I noticed an error reported in the console, Guess it may be related to the writing method of  (…) in es6, So I will make a specific query later I took a look at the issue of compatibility with es6, I learned that webpack can only process a part of ES6 syntax, some more advanced ES6 syntax cannot be processed,Need to do compatibility processing.

 

Solution

1. Install the babel-polyfill es6-promise package

npm i babel-polyfill es6-promise --save

2. Add the following codes to main.js:

import 'babel-polyfill' //Note: This import should be before import Vue from 'vue'
import Vue from 'vue'
import Es6Promise from 'es6-promise'
Es6Promise.polyfill()

3. Add the following codes to webpack.base.conf.js:

module.exports = {
...
     entry: {
     app: ["babel-polyfill", "./src/main .js"]
     },
     ...
}

Because wangeditor5 is a third-party dependency, in node_modules, and babel-polyfill does not detect es6,  in node_modules, we need to add it manually.

Note:If you do not configure es6 compatibility for third-party dependencies,You can ignore the fourth step,You can run the startup project after the third step directly

4. In the webpack.base.conf.js file, modify the configuration of babel-loader, add a configuration item: resolve(‘node_modules/@wangeditor’ )(It needs to be modified according to the third-party dependencies actually introduced)

{
        test: /\.js$/,
        loader: 'babel-loader' ,
        include: [resolve('src'), resolve( 'test'), resolve('node_modules/@wangeditor' ), resolve('node_modules/webpack-dev-server/client')]
      },

Finally restart the project to be successful!

[Solved] Nacos2.1.1 Startup Error: nacos is starting with standalone

Project Scene:

Developing a microservice project, requires the service registration and configuration center. The development and application of Nacos technology. The native OS is Windows11, Nacos version is 2.1.1 installed on Drive D.


Problem description

Nacos start:

Double-click startup.cmd in the bin directory and it will flash back, that is, the startup failed;

Use the command to start: startup.cmd -m standalone, An error message appears

D:\Program Files (x86)\nacos-server-2.1.1\nacos\bin>startup.cmd -m standalone
"nacos is starting with standalone"
There should be no \nacos-server-2.1.1\nacos"\logs\java_heapdump.hprof -XX:-UseLargePages" at this point.


Solution:

The first solution:  unzip Nacos to a directory does not contain non-English and numbers, Command line started successfully

Second solution: Open startup with editor, Comment out the content shown below:

rem if %MODE% == "cluster" (
rem echo "nacos is starting with cluster"
rem if %EMBEDDED_STORAGE% == "embedded" (
rem set "NACOS_OPTS=-DembeddedStorage=true"
rem )

rem set "NACOS_JVM_OPTS=-server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX: HeapDumpPath=%BASE_DIR%\logs\java_heapdump.hprof -XX:-UseLargePages"
rem )

Not sure if this solution will cause other problems, but it starts fine

onnx error: ImportError: /home/dy/anaconda3/envs/torch/lib/python3.6/site-packages/onnx…

onnx error:


import onnx



Traceback (most recent call last):
  File "torch2onnx.py", line 3, in 
    import onnx
  File "/home/dy/anaconda3/envs/torch/lib/python3.6/site-packages/onnx/__init__.py", line 5, in 
    from .onnx_cpp2py_export import ONNX_ML
ImportError: /home/dy/anaconda3/envs/torch/lib/python3.6/site-packages/onnx/onnx_cpp2py_export.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN6google8protobuf7Message17CopyWithSizeCheckEPS1_RKS1_

Solution:

git clone https://github.com/onnx/onnx.git

cd onnx

git submodule update –init –recursive

# Optional: prefer lite proto

export CMAKE_ARGS=”-DONNX_USE_PROTOBUF_SHARED_LIBS=ON”

export CMAKE_ARGS=-DONNX_USE_LITE_PROTO=ON

pip install -e .

zookeeper Failed to Startup: Error: JAVA_HOME is not set and java could not be found in PATH

Obviously, JAVA_HOME is configured normally, but the error is still reported:

hadoop@hadoop-1:/data/apache-zookeeper-3.7.1-bin/bin$ sh zkServer.sh start
zkServer.sh: 78: /data/apache-zookeeper-3.7.1-bin/bin/zkEnv.sh: [[: not found
-p: not found
java is /data/hadoop/jdk1.8.0_202/bin/java
Error: JAVA_HOME is not set and java could not be found in PATH.

 

Solution:

Replace it with ./zkServer.sh start

or bash zkServer.sh start

[Solved] Error detected while processing /root/.vimrc: E492: Not an editor command: Plug ‘scrooloose/nerdtree’

Create a cron task, the error is as follows:

# crontab -e

no crontab for root - using an empty one

Error detected while processing /root/.vimrc:

line    2:

E492: Not an editor command: Plug 'scrooloose/nerdtree'

Press ENTER or type command to continue

 

Solution:

1. Open ~/.bashrc and insert the following red line in the file:

2. Effective source ~/.bashrc

Finish.

flask init-db Error: Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory.

1. Problem description

When flask initializes the database file, execute flask init-db to report Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory, the specific error screenshot is as follows:

 

2. Problem solving

This problem is really annoying. I can’t find the corresponding solution on Baidu. The official document about the flask initialization database is also very vague. I wrote an execution command directly, so I don’t understand it very well, so I do it when initializing the database. The operation is:

1. Shut down the previously started server, open a new terminal and execute the following command:

1
2
3
%export FLASK_APP=flaskr
export FLASK_ENV=development
%flask run

 2. Open another terminal and cd to the package directory to execute the flask inti-db command, and the above error is reported. Obviously this is the wrong step.

3. Solutions

After thinking about this problem for a long time, I want to understand where I am wrong. The correct execution steps should be:

1. Execute the following command

1
2
3
%export FLASK_APP=flaskr
export FLASK_ENV=development
%flask init-db

 2. After the execution is successful, a flaskr.sqlite file will be created in the instance folder. The actual result is shown as follows:

 

 

make Error: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive]

Error message:

     xxx.h:117:59: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive]
     int m_MinValidLen = (int)(&(((DataOnAir *)0)->rx_ts_s));

 

Reason for error:

This is because the pointer type occupies 8 bytes on the 64-bit system based on the Linux kernel, and the int type occupies 4 bytes, so there will be losses precision.

You can convert the int* to the long type first, and the long type can be implicitly converted to the int type. You can directly modify it to long long or long

Modified:

long m_MinValidLen = (long)(&(((DataOnAir *)0)->rx_ts_s));

[Solved] uiautomateviewer Tool Error: Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException

Error Message:

Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist! Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!

 

 

Solution: Turn on developer permissions on the phone, turn the USB debugging button back on, and then restart the emulator

Reference link: https://www.cnblogs.com/uniquefu/p/11496211.html

RECEIVED ERROR PACKET: ERRNO = 1236, SQLSTATE = HY000 ERRMSG = COULD NOT FIND FIRST LOG FILE NAME IN BINARY LOG INDEX FILE

When using canal to synchronize mysql data, the problem of Could not find first log file name in binary log index file cannot find the binlog file. The detailed error is as follows

java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102) ~[canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:237) [canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262) [canal.parse-1.1.6.jar:na]
at java.lang.Thread.run(Thread.java:750) [na:1.8.0_333]
java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102) ~[canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:237) ~[canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262) ~[canal.parse-1.1.6.jar:na]
at java.lang.Thread.run(Thread.java:750) [na:1.8.0_333]
ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:example[java.io.IOException: Received error packet: err
no = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:237)
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262)
at java.lang.Thread.run(Thread.java:750)
]

 

This problem is mainly caused by the logfile being overwritten. You can view the meta.dat file under canal/conf/example to check the location of the currently read binlog file
"postion":{"gtid":"","included":false,"journalName":"mys
ql-bin.000591","position":25928,"serverId":21381487,"timestamp":1663232397000}}}],"destination":"example"}[root@iZ2vcfjagtpbh97ar0zj6cZ example]

 

Then compare the current MySQL binlog file and position
Use show master status to view in MySQL
Solution:
1. Stop the canal server first
2. Delete canal/conf/example/meta.dat
3. Update the canal/conf/example/instance.properties file

canal.instance.master.journal.name=xxx
canal.instance.master.position=xxx
These two fields correspond to the file and position in the current database respectively
4. Restart the canal server
Then you can view canal/logs/example/example.log to check if there is still a problem of not finding the binlog file

./popins2: error while loading shared libraries: libbifrost.so: cannot open shared object file: No such file or directory

001. Question

root@ubuntu01:/home/software/PopIns2/PopIns2# ./ popins2 
. / popins2 : error while loading shared libraries: libbifrost.so: cannot open shared object file: No such file or directory

 

 

002, the cause of the problem

Analysis of the reason: ld prompts that the library file cannot be found, and the library file is in the current directory.

The default directories of the linker ld are /lib and /usr/lib. If they are placed in other paths, you need to let ld know where the library files are.

 

003. Find the file

root@ubuntu01:/home/software/PopIns2/PopIns2# find / -name " libbifrost.so "
 /usr/local/lib/ libbifrost.so
 /home/software/bifrost/build/src/ libbifrost.so 
find: ' / run /user/ 1000 / doc': Permission denied
find: ' /run/user/ 1000 / gvfs': Permission denied
find: ' /run/user/ 127 / doc': Permission denied
find: ' /run/user/ 127 /gvfs': Permission denied

 

004. Solution

method 1:

Edit the /etc/ld.so.conf file and add the directory where the library file is located in a new line;

Run ldconfig to update the /etc/ld.so.cache file;
method 2:

Create any file with a .conf suffix in the /etc/ld.so.conf.d/ directory, and add the directory where the library file is located in the file;

Run ldconfig to update the /etc/ld.so.cache file;

I think the second method is more convenient, with minimal changes to the original system. Because the content of the /etc/ld.so.conf file is include /etc/ld.so.conf.d/*.conf

root@ubuntu01:/home/software/PopIns2/PopIns2# echo " /home/software/bifrost/build/src/libbifrost.so " > /etc/ld.so.conf.d/bifrost.so 
root@ubuntu01 : / home/software/PopIns2/PopIns2# ldconfig ## Update library files

 

005. Test

root@ubuntu01:/home/software/PopIns2/PopIns2# ./popins2

db2 purescale Install Error: ERROR: An error occurred while compiling IBM General Parallel File System (GPFS) Portability Layer (GPL) on host “cf1”. Return code “3”.

background

RedHat Linux 6.5

DB2 10.5.10

Install DB2 purescale and check the installation requirements through db2prereqcheck, but an error is reported when executing db2_install installation:

[rootserver_t]# ./db2_install 
DBI1324W  Support of the db2_install command is deprecated.

Default directory for installation of products - /opt/ibm/db2/V10.5

***********************************************************
Install into default directory (/opt/ibm/db2/V10.5) ? [yes/no] 
yes

Specify one of the following keywords to install DB2 products.

  SERVER 
  CONSV 
  EXP 
  CLIENT 
  RTCL 
 
Enter "help" to redisplay product names.

Enter "quit" to exit.

***********************************************************
SERVER
***********************************************************
Do you want to install the DB2 pureScale Feature? [yes/no] 
yes
DB2 installation is being initialized.

 Total number of tasks to be performed: 53 
Total estimated time for all tasks to be performed: 2201 second(s) 

Task #1 start
Description: Checking license agreement acceptance 
Estimated time 1 second(s) 
Task #1 end 

省略部分...

Task #47 start
Description: Installing or updating DB2 SSH Utilities 
Estimated time 5 second(s) 
Task #47 end 

Task #48 start
Description: Compiling GPL 
Estimated time 30 second(s) 
Task #48 end 

A major error occurred while installing "DB2 Server Edition " on this
computer. The installation cannot continue. If the problem persists contact
your technical service representative.

For more information see the DB2 installation log at
"/tmp/db2_install.log.38995".

Solution

Check /tmp/db2_install.log.38995 log according to the prompt

[root@cf1 server_t]# cat /tmp/db2_install.log.38995
...

ERROR: An error occurred while compiling IBM General Parallel File System
(GPFS) Portability Layer (GPL) on host "cf1". Return code "3". GPL compilation
log file location  "/tmp/compileGPL.log.000". The GPFS file system cannot be
mounted properly until the GPL module is successfully compiled on this host. 
For details, see the specified GPL compilation log. After fixing the problems
shown in the log file, re-run the DB2 installer. For information regarding the
GPFS GPL module compile, see DB2 Information Center.

Compiling GPL :.......Failure 
ERROR: A major error occurred while installing "DB2 Server Edition " on this
computer. The installation cannot continue. If the problem persists contact
your technical service representative.

...

 

Reference: https://www.ibm.com/support/pages/purescale-installation-failed-compiling-ibm-general-parallel-file-system-gpfs-portability-layer-gpl, it should be caused by the kernel version problem.

 

Check the current system kernel version, the operating system kernel version is 2.6.32-754.35

[root@cf1]# uname -r
2.6.32-754.35.1.el6.x86_64

 

Check the installed kernel and find that kernel-2.6.32-431.el6.x86_64 is inconsistent with the kernel version of the operating system

[root@cf1]# rpm -qa | grep kerne
abrt-addon-kerneloops-2.0.8-44.el6.centos.x86_64
kernel-headers-2.6.32-754.35.1.el6.x86_64
dracut-kernel-004-411.el6.noarch
kernel-firmware-2.6.32-754.35.1.el6.noarch
kernel-devel-2.6.32-754.35.1.el6.x86_64
kernel-2.6.32-431.el6.x86_64
kernel-2.6.32-754.35.1.el6.x86_64
libreport-plugin-kerneloops-2.0.9-34.el6.centos.x86_64

 

uninstall kernel-2.6.32-431.el6.x86_64

[root@cf1]# yum remove -y kernel-2.6.32-431.el6.x86_64

 

Re-execute db2_install to successfully install db2 purescale

[root@cf1]# ./db2_install 
DBI1324W  Support of the db2_install command is deprecated.


 
Default directory for installation of products - /opt/ibm/db2/V10.5

***********************************************************
Install into default directory (/opt/ibm/db2/V10.5) ? [yes/no] 
yes
 
 
Specify one of the following keywords to install DB2 products.

  SERVER 
  CONSV 
  EXP 
  CLIENT 
  RTCL 
 
Enter "help" to redisplay product names.

Enter "quit" to exit.

***********************************************************
SERVER
***********************************************************
Do you want to install the DB2 pureScale Feature? [yes/no] 
yes
DB2 installation is being initialized.

 Total number of tasks to be performed: 9 
Total estimated time for all tasks to be performed: 150 second(s) 

Task #1 start
Description: Installing or updating DB2 HA scripts for IBM Tivoli System Automation for Multiplatforms (Tivoli SA MP) 
Estimated time 40 second(s) 
Task #1 end 

Task #2 start
Description: Compiling GPL 
Estimated time 30 second(s) 
Task #2 end 

Task #3 start
Description: Executing control tasks 
Estimated time 20 second(s) 
Task #3 end 

Task #4 start
Description: Updating global registry 
Estimated time 20 second(s) 
Task #4 end 

Task #5 start
Description: Updating the db2ls and db2greg link 
Estimated time 1 second(s) 
Task #5 end 

Task #6 start
Description: Setting default global profile registry variables 
Estimated time 1 second(s) 
Task #6 end 

Task #7 start
Description: Initializing instance list 
Estimated time 5 second(s) 
Task #7 end 

Task #8 start
Description: Registering DB2 Update Service 
Estimated time 30 second(s) 
Task #8 end 

Task #9 start
Description: Updating global profile registry 
Estimated time 3 second(s) 
Task #9 end 

The execution completed successfully.

For more information see the DB2 installation log at
"/tmp/db2_install.log.87073".

Refer to the official solution: https://www.ibm.com/support/pages/purescale-installation-failed-compiling-ibm-general-parallel-file-system-gpfs-portability-layer-gpl