Tag Archives: build

Solution to build error in Vue project (error in static/JS)/vendor.xxxxx.js from UglifyJs)

The project that has been running very well suddenly reported an error in build. The error message is as follows:

ERROR in static/js/vendor.f1c68aa2d5e85847d30e.js from UglifyJs
Unexpected token name «i», expected punc «;» [./node_modules/element-ui/src/utils/merge.js:2,0][static/js/vendor.f1c68aa2d5e85847d30e.js:17064,11]
Build failed with errors.

In uglifyjs’ GitHub issues # 78, we found such a solution: because uglifyjs only supports Es5, and element UI may introduce a part of the writing of ES6, so webpack packaging fails. The final solution given in issue is to replace uglify JS with uglify es of beta version (beta version introduces support for es2015 +). You need to execute the command NPMI - D in the front-end working directory uglifyjs-webpack-plugin@beta

However, after trying, we found that the problem of build error is still unsolved. After searching for the problem, we decided to use bable to parse the element UI. To complete this operation, we only need to modify the build error in the front-end folder/ webpack.base.conf The. JS file can be modified as follows:
before modification

module: {
rules: [
...
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},

After modification

 

module: {
rules: [
...
{
test: /\.js$/,
loader: 'babel-loader',//Note that elementUI's source code needs to be parsed using ES6
include: [resolve('src'), resolve('test'),resolve('/node_modules/element-ui/src'),resolve('/node_modules/element-ui/packages')]
},
...

It is equivalent to adding element UI to the package that needs to be parsed by Babel.

After that, execute NPM run build again, and the build is successful.

Installation of Ubuntu + VTK

Sudo apt-get install libvtk5.2 libvtk5-qt4-dev sudo apt-get install libvtk5.2 libvtk5-qt4-dev
Different Ubuntu versions support different versions of VTK, here is Ubuntu 10.04, followed by QT4 support.
 
two
1. Download source code
Address: http://www.vtk.org/VTK/resources/software.html
The version is the latest
2. Unzip
The tar ZXVF… .
A VTK folder is created in the current directory
3. Install OpenGL
apt-get install mesa-common-dev libgl1-mesa-dev
4. Install ccmake
sudo apt-get install cmake-curses-gui
5.cd VTK
6.mkdir VTK-build
7.cd VTK-build
8.ccmake .. /
9. Press C to start the configuration and set VTK_USE_QT to ON. BUILD_SHARED_LIBS is set to ON
10. Press T to enter detailed setup, then locate QT_QMake_Executable, press ENTER to modify, and change QMAKE
The path of the input, for example:/home/zhang/QtSDK/Desktop/Qt/4.8.0/GCC/bin/qmake. Confirm and press Enter to exit the modification.
11. Press C to check the Settings.
12. Confirm by C.
13. Press G to generate makefile and exit CCMAKE automatically
14.make
15.sudo make install.
 
Add (.pro file) to the project
INCLUDEPATH =/usr/local/include/VTK to 5.10
LIBS + = L/usr/local/lib/VTK – 5.10 \
 
5.2
INCLUDEPATH =/usr/include/VTK to 5.2
LIBS += -L/usr/lib \
Select as needed at the end
-lvtkCommon -lvtksys -lQVTK -lvtkViews -lvtkWidgets -lvtkInfovis -lvtkRendering -lvtkGraphics -lvtkImaging -lvtkIO -lvtkFiltering -lvtklibxml2 -lvtkDICOMParser -lvtkpng -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkalglib -lvtkexpat -lvtkverdict -lvtkmetaio -lvtkNetCDF -lvtksqlite -lvtkexoIIc -lvtkftgl -lvtkfreetype -lvtkHybrid
 
Command line compilation
G + + – o Cylinder – O3 – I/usr/include/VTK – 5.2 – L/usr/local/lib – Wno – deprecated – lvtkCommon lvtkDICOMParser – lvtkexoIIc – lvtkFiltering – LVTKFTGL – lvtkGenericFiltering lvtkGraphics — lvtkHybrid -lvtkImaging -lvtkIO -lvtkNetCDF -lvtkRendering -lvtksys -lvtkVolumeRendering -lvtkWidgets Cylinder.cxx
 
 

Windows FTP Error 425: Unable to build data connection

http://www.trapstone.com/articles/windows_ftp_425_connection_refused

Having problems transferring files with FTP?If you are using the command line FTP client within Windows and getting errors like these…

500 Illegal PORT command 425 Unable to build data connection: Connection refused

Well, don’t worry – you’re in good company.
This is probably one of the most commonly encountered problems by Windows users with the command line FTP client, primarily when connecting to servers that use non-default ports.
This article explains why … and what you can do about it.
Illegal Port Command – Why FTP may be running on a non-standard port
Every day, countless attempts are made to get access to servers via FTP by guessing account names and passwords.
As a result, many companies who provide FTP access to their customers have configured their servers to run FTP on a non-standard port (i.e. anything other than the default port 21).
Normally this should not be a problem, as you can tell your FTP client which port to connect to on the server and to use passive mode. If you don’t know what passive mode is all about, take a look at the article on Active FTP vs. Passive FTP.
Why Windows FTP Can’t Build A Data Connection
If you use the standard FTP client (the command line one) that comes bundled with Microsoft Windows, then you will find that even if you specify a different port number, you cannot enable passive mode.
Note also that you can’t specify the port number on the command line itself as a server.name:port pair (unlike pretty much every other command line FTP client on the planet).
Instead, you can only attempt this from within the client interactively. For example, here’s a session from an attempt to connect to one of our FTP servers which is running on port 7021…

Here we can see our attempt to connect to our server on it’s non-standard port is successful.
However, as soon as we attempt to transfer data, the attempt to open a secondary port for the data flow fails. Microsoft’s own article on the Windows FTP Client Receives Error Message 425 points out that:

“The FTP clients that ship with Windows do not support passive mode. Therefore, they always need to negotiate a data port when issuing a command that returns data.”

As a result, even if you do correctly specify a non-default port number, you still cannot use passive mode.
Sigh… cheers guys.
Note that you may find a lot of articles on the ‘net claiming that Windows FTP client does support passive FTP – often because they’ve seen the PASV entry in the registry or because the client appears to accept the literal pasv command.
It does not work with the Windows command line FTP client!
The server might respond to a PASV command with a message saying it is in passive mode but the Windows command line client has silently ignored it.
How You Can Use Passive FTP Under Windows
Internet Explorer can support passive mode as an FTP client if you enable it in the “Internet Options”, although that’s only useful for retrieving files – you can’t upload via Internet Explorer.
For full bidirectional FTP functionality, the simple answer is to not use the Windows command line FTP client at all.
We recommend that you use something like FileZilla, which provides a clear, friendly and useful interface – and it’s free!. Alternatively, Firefox users can get the FireFTP add-on to integrate bi-directional FTP with their browser.
If security is a concern and if the FTP server supports SSH connections, you may also want to download SFTP, which is part of the PuTTY SSH client distribution. This is also free and FileZilla supports SFTP as an alternative backend.