2024年6月20日 星期四

Fix Git CRLF issue

git config --global core.autocrlf input


 https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf



https://www.huanlintalk.com/2011/05/git-coreautocrlf.html

2024年5月27日 星期一

Use nvm-windows but not able to switch to correct node version

 Install NVM-Windows

remove the nodejs windows version

nvm install 18

nvm ls (see 18)

nvm use 18 (say used)

node -v

'node' is not recognized as an internal or external command,

operable program or batch file.

solve: Go to C:\Programs\nodejs

remove the folder C:\Programs\nodejs

then check again will success

2023年2月14日 星期二

NET::ERR_CERT_INVALID 頁面沒有繼續前往XXX網站的連結

 開啟一個沒有SSL的網站,會被 Chrome 認為是不安全的網站,由於憑證不被信任的關係會出現錯誤代碼 NET::ERR_CERT_INVALID

若已知是安全的,通常點擊「進階」會出現「繼續前往 XXXX 網站(不安全)」後就能進入



但有時候不知為何Chrome會擋住,連點擊的連結都消失了,例如下圖:


別緊張,這時候在網頁空白處,點擊一下,並輸入「thisisunsafe」,就可以連線了喔!







2021年10月26日 星期二

Docker Desktop Upgrade Failed

 

Docker Desktop Upgrade Failed



Here is a new update version could install

Click Install & Restart but not working.


Or select "Download update" to upgrade Docker Desktop


It starts to downloading, but always failed or no response.


Says installation failed.



The problem might be the service won't stop, let us stop it manually.


Go to Windows Services, find out Docker Desktop Service, then stop it.



Then it's stoping.


Download install file from official website: 
Docker Desktop


Execute the install package, start to install.


If you see it's unpacking, sound good.



It might occur some warning, ignore it.



Finally, the installation succeeded.



Chck out the About dialog, it's updated.


2021年8月7日 星期六

How to remove OneDrive 如何移除

Terminated process first.
(首先停止正在執行的OneDrive程序)

 taskkill /f /im OneDrive.exe

According to your OS type:
(根據OS版本)

open cmd with administrator permission
(以系統管理員身份執行)

32bit
%SystemRoot%\System32\OneDriveSetup.exe /uninstall

64bit
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

2021年5月4日 星期二

Webstorm can't resolve module with vue-cli, setup webpack config for alias. 解決Webstorm無法解析路徑的問題

WebStorm can't resolve alias if project created by vue-cli.

Because vue-cli didn't set up via webpack, the alias can't resolved without webpack config.

To fix this problem, we can specify a webpack config for WebStorm to recognize alias.

[Setting] > [Language & Frameworks] > [JavaScript] > [Webpack]



Here are my references.

[1] https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000556284/comments/360000093780

[2] https://juejin.cn/post/6844903802185891848

[3] https://cli.vuejs.org/guide/webpack.html#inspecting-the-project-s-webpack-config


Updated

In unknown problem, all above action can't fix the resolution issue. But I found some trick: Go to any *.vue file, move to import block, right click on any component then install it. And it will solved. Unbeleible. Amazing.


Updated-2

No need to set webpack config because it always says: 
Can't analyse webpack.config.js: coding assistance will ignore module resolution rules in this file.
The rest current setting: node_module was excluded. src was rescouce root.
Rewritre vue.config.js, let it re-index, then it can resolved correctly.
I rewrite 

config.resolve.alias
.set('@img', path.resolve(__dirname, 'src/asset/images'))
.set('@common', path.resolve(__dirname, 'src/components/common'))
.set('Source', path.resolve(__dirname, 'src'));
to
config.resolve.alias
.
set('_img', path.resolve(__dirname, 'src/asset/images'))
.
set('_common', path.resolve(__dirname, 'src/components/common'))
.
set('Source', path.resolve(__dirname, 'src')); then re-write back
config.resolve.alias
.set('@img', path.resolve(__dirname, 'src/asset/images'))
.set('@common', path.resolve(__dirname, 'src/components/common'))
.set('Source', path.resolve(__dirname, 'src'));

Updated-3

[Setting] > [Language & Frameworks] > [JavaScript] > [Webpack]
=> Set as Automatic.


Select node_module folder, right click to popup menu, click "Optimize Imports"
=> it's work!

Or, select "src" root, do "Optimize Imports".
=> it's work!

Or, select any single *.vue, do "Optimize Imports".


[1] https://youtrack.jetbrains.com/issue/WEB-27933



2021年4月1日 星期四

解決執行Bat檔案,第一行是亂碼。不是內部或外部命令、可執行的程式或批次檔。


 如上圖,每次執行BAT檔第一行一定會出現亂碼報錯。

這有可能是該BAT檔的文件編碼選到UTF-8。

要正確顯示BAT檔,需改成ANSI格式。

可利用Notepad++或以記事本開啟BAT檔後另存新檔時將編碼改選為ANSI

以上