atom-package 安裝緩慢,手動安裝

rachelnew1900發表於2020-11-27

根據udemy angela yu 的課程推薦,使用atom 編輯器學習web development,編輯器atom 包安裝緩慢,使用git 複製安裝

Atom Packages

Recommended

  1. atom-beautify
  2. atom-ternjs
  3. autoclose-html
  4. emmet
  5. csslint
  6. pigments
  7. language-ejs

Optional Packages

  1. atom-html-preview
  2. Sublime-Style-Column-Selection
  3. linter-eslint

手動安裝

apm是Atom Package Manager

$ apm 

apm - Atom Package Manager powered by https://atom.io

Usage: apm <command>

where <command> is one of:
    ci, clean, config, dedupe, deinstall, delete, dev, develop, disable, docs,
    enable, erase, featured, home, i, init, install, link, linked, links, list,
    ln, lns, login, ls, open, outdated, prune, publish, rebuild,
    rebuild-module-cache, remove, rm, search, show, star, starred, stars, test,
    uninstall, unlink, unpublish, unstar, update, upgrade, view.

Run `apm help <command>` to see the more details about a specific command.

選項:
  --color        Enable colored output                  [boolean] [預設值: true]
  -v, --version  Print the apm version
  -h, --help     Print this usage message

1. atom-beautify安裝

https://github.com/Glavin001/atom-beautify

  #切換至atom安裝目錄
 cd ~/.atom/packages
 #使用git複製package內容
git clone https://github.com/Glavin001/atom-beautify
cd atom-beautify
npm install

npm: command not found 報錯:

npm: command not found

原因:系統中沒有 nodejs 環境
使用以下程式碼檢視 nodejs 版本

$ brew info node@10
node@10: stable 10.23.0 (bottled) [keg-only]
Platform built on V8 to build network applications
https://nodejs.org/
Not installed
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/node@10.rb
License: MIT
==> Dependencies
Build: pkg-config ✔
Required: icu4c ✘
==> Requirements
Required: macOS ✔
==> Caveats
node@10 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

==> Analytics
install: 13,398 (30 days), 36,900 (90 days), 177,145 (365 days)
install-on-request: 10,981 (30 days), 30,949 (90 days), 155,213 (365 days)
build-error: 0 (30 days)

檢視系統中npm 版本,果然沒有

$ npm -v
-bash: npm: command not found

使用homebrew安裝

brew install node@10

安裝後測試:

$ npm -v
-bash: npm: command not found

可能環境配置不對,重新配置環境
參看文章:mac-環境配置檔案zsh及bash環境變數配置

$ echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile
$ source .bash_profile

確認npm 版本

$ npm -v
6.14.8

切回atom包所在路徑

2. atom-ternjs安裝

https://github.com/tststs/atom-ternjs

3. autoclose-html安裝

https://atom.io/packages/autoclose-html

$ apm install autoclose-html
Installing autoclose-html to /Users/Rachel1900/.atom/packages ✓

4. emmet-atom安裝

官網 https://atom.io/packages/emmet
安裝步驟:

$cd ~/.atom/packages
$git clone https://github.com/emmetio/emmet-atom
$cd emmet-atom
$npm install

5. csslinte 安裝

https://atom.io/packages/csslint

CSSLint error reports for your Atom editor.

$ apm install csslint
Installing csslint to /Users/Rachel1900/.atom/packages ✓

6. pigments安裝

https://atom.io/packages/pigments

A package to display colors in project and files.

$apm install pigments
Installing pigments to /Users/Rachel1900/.atom/packages ✓

7. language-ejs安裝

https://atom.io/packages/language-ejs

EJS support for Atom.

 git clone  https://github.com/gregory-m/ejs-tmbundle

參考:

  1. how-to-install-packages-in-atom
  2. https://flight-manual.atom.io/using-atom/sections/atom-packages/
  3. atom 安裝緩慢
  4. https://atom.io/packages/emmet
  5. 解決 mac 系統報zsh: command not found: npm 問題
  6. stackoverflow

相關文章