"apm list -b" and "apm i --packages-file" are incompatible with git packages
Prerequisites
- [X] Put an X between the brackets on this line if you have done all of the following:
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
Description
I'm trying to back up Atom installed packages with apm list -ib, and I expected the output of this command to be compatible with apm install --packages-file, but this isn't the case if there are git packages installed.
This issue is a lot like #833, but that's closed so I opened another one as stated here.
I would like to be able to do
apm list -ib > atom-packages.list
and then
apm install --packages-file atom-packages.list
but this produces an error when apm tries to install a git package.
Steps to Reproduce
- Install a git package:
apm i GhostText/GhostText-for-Atom - Create list file:
apm list -ib > atom-packages.listThis file now contains only the single line[email protected] - Install packages listed:
apm i --packages-file atom-packages.list
Expected behavior:
I expect it to smoothly install GhostText/GhostText-for-Atom.
Actual behavior:
It throws the following error:
$ apm i --packages-file atom-packages.list
Installing [email protected] to ~/.atom/packages ✗
Request for package information failed: Not Found
Versions
$ apm --version
apm 2.4.3
npm 6.2.0
node 10.2.1 x64
atom 1.40.1
python 2.7.16
git 2.20.1
The system is Lubuntu 19.04, linux kernel 5.0.0-13-generic
Thanks for opening a new issue and for sharing those repro steps :+1: I can reproduce on macOS 10.14.6 with Atom 1.40.1. I temporarily reset to factory defaults and then followed your steps and see the same error though I'm still not sure why my attempt to reproduce using defunkt/zen didn't reproduce (/cc https://github.com/atom/apm/issues/833#issuecomment-488556826)?
I think the difference is that zen is actually a "normal" (I don't know the right name, sorry) package, ie. is listed on atom.io (https://atom.io/packages/zen) and the repo is for development or something, so you can actually install from it (it has version tags, so it also get the correct version) but when apm list -b outputs it you get a name that is found on atom.io
On the other hand ghost-text isn't listed (https://atom.io/packages/search?q=ghost-text), so apm can't find it.
Simply speaking: I can do apm i zen and it works, while apm i ghost-text doesn't.
Hello I’m experiencing the same issue here. I’m using this functionality to be able to popup quickly new machine with my usual packages but it just doesn’t work. Is there any plan on doing something about it. The package install tool in the UI doesn’t use apm in the background ?
Thanks for the clarifications.
Maybe a some details of my issue would help here
My issue
I’m exporting the list of my packages with :
apm ls --installed --bare > my-packages.txt
output:
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
then try to install this list with:
apm i --package-file my-packages.txt
I’m getting after few second of process running:
Installing modules done
And I don’t have any modules installed…
My current workaround with Powershell,
Is to clean up my-packages.txt
((Get-Content -path my-packages.txt -Raw) -replace '@(.*)','') | Set-Content -Path my-packages.txt
to get this
atom-beautify atom-package-sync atom-python-run atom-wrap-in-tag autocompiler-pug-jade autocomplete-python highlight-colors language-autohotkey2 language-groovy language-markdown language-powershell language-pug linter-pug lorem markdown-pdf markdown-to-html markdown-writer open-in-browser platformio-ide-terminal python-indent script source-preview source-preview-pug split-diff Sublime-Style-Column-Selection
Then install with apm i by reading line by line the content of the file
foreach($line in Get-Content $env:HOMEPATH\.atom\my-packages.txt) {
apm i $line
}