Atom Editor IDE

Source Insight 用來看 code 蠻方便的, 

想找一個在 Mac 上類似像 Source Insight 的程式,

看到這個主要用 Java Script 所做的開源編譯器. 

    Atom wiki

    Github


很可惜的, Github 要把 Atom 給砍了

Why GitHub Is Killing Atom Text Editor

因為趨勢是走雲端 IDE server 將來收月租費

The 13 Best Browser IDEs Every Programmer Should Know About

目前 Github 上的 Atom 已經封存不再繼續. 

其實這個 Editor 蠻不錯的, 之前有些也從這得到啟發, 改寫成自己的. 



 
想想來問問 chatGPT



不過我習慣用 brew, 所以 javascript 可以用底下方式

% brew install nvm


You should create NVM's working directory if it doesn't exist:


  mkdir ~/.nvm


Add the following to ~/.zshrc or your desired shell

configuration file:


  export NVM_DIR="$HOME/.nvm"

  [ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh"  # This loads nvm

  [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion


You can set $NVM_DIR to any location, but leaving it unchanged from

/usr/local/opt/nvm will destroy any nvm-installed Node installations

upon upgrade/reinstall.








所以保險起見 .zshrc 還可以再加上:
export NVM_DIR="/Users/neojou/.nvm"
後, 再執行 nvm install node

% nvm ls

->      v19.3.0

default -> node (-> v19.3.0)



% npm install

可以發現很多都是舊的了, 這就是用套件兜的問題. 
當使用的套件很多時, 各套件版本相容衍生的問題會指數性的放大.





brew install node@14
node 10 和 node 12 已經太舊不能用brew 安裝了




% npm install

npm WARN old lockfile 

npm WARN old lockfile The package-lock.json file was created with an old version of npm,

npm WARN old lockfile so supplemental metadata must be fetched from the registry.



移除掉看看
% mv package-lock.json package-lock.json.bak

這樣
npm install ok 

接著做
% script/build


問題 1 : node-gyp


% npm install -g node-gyp



% sw_vers

ProductName: Mac OS X

ProductVersion: 10.15.7

BuildVersion: 19H2026



 % curl -sL https://github.com/nodejs/node-gyp/raw/main/macOS_Catalina_acid_test.sh | bash

Command Line Tools not found



% sudo xcode-select -s /Applications/Xcode.app/Contents/Developer


% xcodebuild -version


Xcode 11.3.1

Build version 11C504


但改用 UI 也還是沒辦法通過




我做完第四步的重裝後, 接著做底下把 xcode 導到 command line tools 就可以了:

% sudo xcode-select --switch /Library/Developer/CommandLineTools

% curl -sL https://github.com/nodejs/node-gyp/raw/main/macOS_Catalina_acid_test.sh | bash
Command Line Tools version: 12.4.0.0.1.1610135815

這時 gcc -v 會出現

% gcc -v

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1

Apple clang version 12.0.0 (clang-1200.0.32.29)

Target: x86_64-apple-darwin19.6.0

Thread model: posix

InstalledDir: /Library/Developer/CommandLineTools/usr/bin



問題2: node_modules 下已有目錄, 裡面不是空的



看來前一個問題有解掉, 接下來就是把 node_modules/ 底下有這些問題的目錄刪除編譯看看. 

問題3 : nan V8 


npm ERR! ../../nan/nan_callbacks.h:55:23: error: no member named 'AccessorSignature' in namespace 'v8'

npm ERR! typedef v8::Local<v8::AccessorSignature> Sig;

npm ERR!                   ~~~~^

npm ERR! In file included from ../src/main.cc:1:

npm ERR! ../../nan/nan.h:2536:8: error: no matching member function for call to 'SetAccessor'

npm ERR!   tpl->SetAccessor(

npm ERR!   ~~~~~^~~~~~~~~~~


再來的這個問題可能就需要改 code, 先把 package-lock.json 還原看看.

看來這邊會把 相關版本套件放到 nodes_module 下

不過 npm install 就會失敗了.. 繼續不理往下做時, 同樣問題就會再發生...
先安裝 atom 的執行檔玩看看. 將來有機會回來繼續重寫完善.


之後若要繼續幫助這個 project 的話, 可以參考: 
但這案子從 2022.12.16 開始, 已經被封存只能讀不能寫. 







留言

熱門文章