快轉到主要內容

解決本站故障小記

·505 字·2 分鐘
Y Cheung
作者
Y Cheung
Blogger, Programer & Traveler.

本站突然發生 HTTP502 錯誤,導致幾天不能訪問,又適逢勞動節休假,Y.CHEUNG 沒帶電腦,而且縂想著反正訪問量極低,也就不趕著修復站點,今日才來細細察看一番。

原來是前些時候系統及應用更新,Node.js 版本太新了的緣故(QAQ),真的是很想駡娘欸,明明説明文檔上寫著

Ghost is following Node’s LTS plan, only supporting LTS versions of Node (read why).

而 Node.js 官網已經標示了目前 LTS 的版本號是 v6.10.2 ,Y.CHEUNG 就不明白了,爲什麽啓動ghost就出現了提示說ghost不支持當前版本呢?ANYWAY,問題是要解決的,那就降Node.js版本吧。

這個…升級好説,一句命令行的事,降級怎麽搞哇?

上網搜了一圈,有同樣需求的還真不少,爲此還專門推出了 node.js 的版本管理工具 nmvn ,YCHEUNG選擇了安裝步驟和使用方法都很簡便的n,但是…切換了版本后沒效果QAQ,又找了一圈是說不要用系統自帶安裝命令來裝node.js,想到要卸載又要重新用別的複雜方法裝node.js就很討厭,還好找到了這篇《node 版本管理工具 n 无效的原理及解决方案》,解釋得很清楚解決方案也簡單明瞭,照著做了就好了。

終於,網站恢復啦~~~賀喜自己XD

附上一張假日去玩的美景圖~PEACE

重元寺

相關文章

MYSQL外鍵導致無法清空表

·132 字·1 分鐘
最近設計的數據庫表含有外鍵,結果在開發時truncate table的時候報錯了, 1SQL错误(1701):Cannot truncate a table referenced in a foreign key constraint (`rollcall2`.`oncall`, CONSTRAINT `FK__calls` FOREIGN KEY (`calls_id`) REFERENCES `rollcall2`.`calls` (`id`)) 解決辦法如下: 1SET FOREIGN_KEY_CHECKS = 0; 2TRUNCATE table; 3SET FOREIGN_KEY_CHECKS = 1; 當然也可以通過移除外鍵之類的辦法,但是感覺還是用上面幾行命令來解決比較方便。

使用 extundelete 恢复rm误操作

·438 字·1 分鐘
系统:CentOS 7 文件系统:EXT4 今天 YCHEUNG 不小心用 rm 命令误删了一个名字奇奇怪怪的文件,因为名字太奇怪想不起来它是啥,怕是重要文件,所以急急忙忙去找办法恢复。

FEDORA安装electron-builder报错make:g++:命令未找到之解决

·354 字·1 分鐘
系统环境: Fedora 24 Node v4.5.0 NPM v2.15.9 NPM安装electron-builder报错 # 1$npm install electron-builder --save=dev 2npm WARN package.json [email protected] No repository field. 3npm WARN package.json [email protected] No README data 4 5> [email protected] install /var/www/html/test/node_modules/dev/node_modules/inotify 6> node-gyp rebuild 7 8make: Entering directory '/var/www/html/test/node_modules/dev/node_modules/inotify/build' 9 CXX(target) Release/obj.target/inotify/src/bindings.o 10make: g++:命令未找到 11inotify.target.mk:97: recipe for target 'Release/obj.target/inotify/src/bindings.o' failed 12make: *** [Release/obj.target/inotify/src/bindings.o] Error 127 13make: Leaving directory '/var/www/html/test/node_modules/dev/node_modules/inotify/build' 14gyp ERR! build error 15gyp ERR! stack Error: `make` failed with exit code: 2 16gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:276:23) 17gyp ERR! stack at emitTwo (events.js:87:13) 18gyp ERR! stack at ChildProcess.emit (events.js:172:7) 19gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) 20gyp ERR! System Linux 4.7.4-200.fc24.x86_64 21gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 22gyp ERR! cwd /var/www/html/test/node_modules/dev/node_modules/inotify 23gyp ERR! node -v v4.5.0 24gyp ERR! node-gyp -v v3.4.0 25gyp ERR! not ok 26npm WARN optional dep failed, continuing [email protected] 27npm WARN deprecated [email protected]: This package is deprecated. Use Object.assign. 28npm WARN optional dep failed, continuing [email protected] 29npm WARN optional dep failed, continuing [email protected] 30npm ERR! Linux 4.7.4-200.fc24.x86_64 31npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "electron-builder" "--save=dev" 32npm ERR! node v4.5.0 33npm ERR! npm v2.15.9 34npm ERR! code ELIFECYCLE 35 36npm ERR! [email protected] install: `node-gyp rebuild` 37npm ERR! Exit status 1 38npm ERR! 39npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. 40npm ERR! This is most likely a problem with the inotify package, 41npm ERR! not with npm itself. 42npm ERR! Tell the author that this fails on your system: 43npm ERR! node-gyp rebuild 44npm ERR! You can get information on how to open an issue for this project with: 45npm ERR! npm bugs inotify 46npm ERR! Or if that isn't available, you can get their info via: 47npm ERR! 48npm ERR! npm owner ls inotify 49npm ERR! There is likely additional logging output above. 50 51npm ERR! Please include the following file with any support request: 52npm ERR! /var/www/html/test/npm-debug.log 解决方法: # 安装G++ $sudo dnf install gcc-c++

Unity AvProVideo Plugin 中設置影片在安卓SD卡上的絕對地址

·359 字·1 分鐘
Media Play 設置 # Video Location 選擇 Absolute Path Or URL。 找到安卓設備SDCard的根目錄(ROOT PATH) # 如果電腦上安裝了adb工具,使用指令 adb shell echo $EXTERNAL_STORAGE 打印SD Card Root directory。 如果安卓設備上安裝了terminal工具,(比如Terminal Emulator for Android),使用指令 ls 根據經驗篩選可能的目錄。 一般而言,SD卡的根目錄可能但不限於以下幾種: /mnt/sdcard /storage/sdcard0 /storage/sdcard /sdcard 設置權限 # 在 AndroidManifest.xml 文件中的<uses-sdk前添加以下語句: 1<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 通常該文件位於Assets/Plugins/Android/文件夾內,該配置文件詳解請參閱官方文檔《App Manifest》(有中文版)。

Windows7安裝Android Studio報錯 ERROR1812

·108 字·1 分鐘
在 Win7 上運行 Android Studio 安裝包的時候,一直報錯 Unable to elevate[error:1812] 上網搜了一下,原來是windows兼容性問題orz… 解決方案: 鼠標右擊,選擇 “兼容性疑難解答”,選擇 “嘗試建議的設置”,選擇啟動程序 ,然後一直點擊下一步就好了。

Aliyun MySQL Aborting

·331 字·1 分鐘
放了wordpress的主機最近經常掛掉,提示無法連結數據庫,檢查log信息發現是因為內存不足,把InnoDB的buffer pool size改小後似乎好了一些,可今天還是出錯了,log信息如下: