简体   繁体   English

如何手动下载原子编辑器的包并(手动)安装它们?

[英]How can I manually download packages for atom editor and install them (manually)?

Due to poor inte.net connection my atom packages won't install from settings>preferences>install>packages .由于 inte.net 连接不佳,我的原子包无法从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.例如:我从相应的 github 页面尝试了存储库并将其克隆到users>.atom>packages中,但这没有用。

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!随时欢迎任何其他方式!

In linux: 在linux中:

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

You have to install npm first. 你必须先安装npm。

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. 您可以下载软件包,解压缩或解压缩,转到该文件夹​​并运行:apm链接,它将创建从该软件包到〜/ .atom / packages文件夹的符号链接。

But ensure that you install all dependencies require by the package also, as if you dont have internet connection then you may encounter issues. 但是请确保您还要安装包所需的所有依赖项,就好像您没有Internet连接那么您可能会遇到问题。

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. 当您手动下载并解压缩zip文件时,需要在程序包的目录中运行apm install以引入任何依赖项。 This will download all dependencies and place them in the node_modules folder and recursively pulls in their dependencies as well. 这将下载所有依赖项并将它们放在node_modules文件夹中,并以递归方式提取它们的依赖项。 Since this is not possible in your environment, you'll have to do that manually. 由于这在您的环境中是不可能的,因此您必须手动执行此操作。

Recursively go over each package.json file. 递归遍历每个package.json文件。 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. 如果它在包的npm6上列出一个包作为依赖项搜索,并按照包的github页面的链接来读取它的package.json并重复整个过程。

Hope this helps in anyway. 无论如何,希望这会有所帮助。 Lemme know if i can help further once you have tried. Lemme知道一旦你尝试过,我是否可以提供更多帮助。

to get npm, juste install the node.js, automatically npm will be installed,then run: 得到npm,juste安装node.js,自动安装npm,然后运行:

cd ~/.atom/packages

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

and it's done. 它已经完成了。

Option 1: use the atom package manager (apm)选项 1:使用原子 package 管理器 (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.其中 github 链接与您通常用于克隆存储库的链接相同。

apm install documentation apm install文档

$ 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选项 2:手动下载

The following seemed to work for me on MacOS以下似乎在 MacOS 上对我有用

cd ~/.atom/packages
git clone https://github.com/url_to_your_package
cd your_package
apm install
  • note apm not npm注意apm不是npm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM