18

Due to poor internet connection my atom packages won’t install from settings>preferences>install>packages. So I think I need to manually install them.

For example: I tried the repository from respective github page and cloned it in users>.atom>packages but this didn't work.

Any help? I love this text editor so it would be pretty handy if I could install more packages manually.

Any other ways are always welcome!

Vel
  • 9,027
  • 6
  • 34
  • 66
Pramesh Bajracharya
  • 2,153
  • 3
  • 28
  • 54

4 Answers4

27

In linux:

cd ~/.atom/packages
git clone https://github.com/url_to_your_package
cd your_package
npm install

You have to install npm first.

Haoyuan Ge
  • 3,379
  • 3
  • 24
  • 40
6

There are a few ways, most are similar to this :

You can download the package, unzip or decompress, go to that folder and run: apm link that will create a symbolic link from that package to your ~/.atom/packages folder.

But ensure that you install all dependencies require by the package also, as if you dont have internet connection then you may encounter issues.

There some good information here i will quote for your convenience that outlines how to handle this :

When you manually download and extract the zip file you need to run apm install in the package's directory afterwards to pull in any dependencies. This will download all dependencies and place them in the node_modules folder and recursively pulls in their dependencies as well. Since this is not possible in your environment, you'll have to do that manually.

Recursively go over each package.json file. If it lists a package as a dependency search on npm6 for the package and follow the link to package's github page to read its package.json and repeat the whole process.

Hope this helps in anyway. Lemme know if i can help further once you have tried.

D3181
  • 2,037
  • 5
  • 19
  • 44
  • I'm a beginner so can you please guide me through the apm part .. Is it done through opening command line (shift + left mouse click and open command window here)? If yes then it shows " 'apm' is not recognized as an internal or external command. @Dean219 operable program or batch file." – Pramesh Bajracharya Aug 22 '16 at 16:48
  • 1
    @PrameshBajracharya You did not specify you are using Windows and he assumed you were not. This all becomes more complicated on Windows. – Matthew Schuchard Aug 23 '16 at 11:43
  • oops yea right! I forgot to mention windows. Any solution? – Pramesh Bajracharya Aug 23 '16 at 14:02
  • 2
    According to most online documentation APM should be provided by default as a command after installing, but if its not you should be able to go to the directory from your commandline and run apm, it will usually be in the directory : C:\Users\yourUserName\AppData\Local\atom\bin on windows. Once there you should in theory be able to follow the guide posted above but let me know once you have fixed your APM missing command issue. Also you should look into adding the directory with the APM.cmd etc into your environment variables to make things easier from commandline – D3181 Aug 23 '16 at 14:13
  • @Dean219 Thank you for your help! The apm command seem to be working in the directory (C:\Users\myUserName\AppData\Local\atom\bin\) only . After I do `apm install atom-beautify` on the very directory it seems that it tries to install the package in it's original directory(ie. C:\Users\myUserName\.atom\packages). I'm currently trying to install some of the packages and will let you know if any progress is done. Thank you. – Pramesh Bajracharya Aug 24 '16 at 18:06
  • 1
    [edit] :: Finally this way worked! Using `apm install ` did all my installs. Thank you very much. – Pramesh Bajracharya Aug 24 '16 at 18:17
3

Option 1: use the atom package manager (apm)

From the command line:

apm install <github repo link>

Where the github link is the same link you'd normally use to clone the repository.

apm install documentation

$ apm help install

Usage: apm install [<package_name>...]
       apm install <package_name>@<package_version>
       apm install <git_remote>
       apm install <github_username>/<github_project>
       apm install --packages-file my-packages.txt
       apm i (with any of the previous argument usage)

Install the given Atom package to ~/.atom/packages/<package_name>.

If no package name is given then all the dependencies in the package.json
file are installed to the node_modules folder in the current working
directory.

A packages file can be specified that is a newline separated list of
package names to install with optional versions using the
`package-name@version` syntax.

Options:
  --check           Check that native build tools are installed                            [boolean]
  --verbose         Show verbose debug information                        [boolean] [default: false]
  --packages-file   A text file containing the packages to install                          [string]
  --production      Do not install dev dependencies                                        [boolean]
  -c, --compatible  Only install packages/themes compatible with this Atom version          [string]
  -h, --help        Print this usage message
  -s, --silent      Set the npm log level to silent                                        [boolean]
  -q, --quiet       Set the npm log level to warn                                          [boolean]

  Prefix an option with `no-` to set it to false such as --no-color to disable
  colored output.

Option 2: Download manually

The following seemed to work for me on MacOS

cd ~/.atom/packages
git clone https://github.com/url_to_your_package
cd your_package
apm install
  • note apm not npm
Cole
  • 600
  • 6
  • 12
2

to get npm, juste install the node.js, automatically npm will be installed,then run:

cd ~/.atom/packages

git clone https://github.com/package-name your_package
cd your_package
npm install

and it's done.

Momo Setti
  • 317
  • 2
  • 14