Apm: Install packages in a custom location when using Atom as portable

Created on 27 Jan 2017  Â·  7Comments  Â·  Source: atom/apm

Prerequisites

Description

It looks like it's currently not possible to use the apm command in while using Atom as portable version in a custom location (see step 2 and 3) (on Windows).

Steps to Reproduce

  1. Download atom-windows.zip
  2. Create .atom in custom location like C:\Users\username\portables\.atom
  3. Extract to custom location like C:\Users\username\portables\Atom
  4. Enable the apm command via the environmental variables by adding C:\Users\sknit\portables\Atom\resources\cli to the users Path variable
  5. Run apm install to install some package

Expected behavior: It installs toC:\Users\username\portables\.atom\packages (as defined in step 2)

Actual behavior: It tries to install to C:\Users\username\.atom\packages

Reproduces how often: 100%

Versions

  • atom 1.13.0
  • apm 1.14.1

Additional Information

I found this PR (https://github.com/atom/apm/pull/421) which seems to address this issue, but seems to be dead though. Any news on this?

bug

Most helpful comment

Just do a SET ATOM_HOME=C:\Users\username\portables\.atom first and you should be good to go.

If you want this to be permanent change SET to SETX.

All 7 comments

/cc @damieng

Adding apm to your path goes against the spirit of a portable install.

Does using the settings pane to add/remove packages work correctly? I suspect it does and this is the scenario we support for calling apm in portable installations.

In the scenario above I'd recommend setting ATOM_HOME to where the .atom file lives.

You are propably right with adding apm to the Path. My intention behind this is to get the apm CLI running to be able to comfortable installing a long list of packages at once. So installing through the UI works, but you can't install multiple packages at once.

Just do a SET ATOM_HOME=C:\Users\username\portables\.atom first and you should be good to go.

If you want this to be permanent change SET to SETX.

Thank you that works! And I think this will be enough for me.

One important and MAJOR thing - should be documented BTW.

If you are using Atom in portable mode and are behind a proxy and if you managed to make APM work for default directory (not your portable one) do this:

this is generally bulletproof way to make Atom work behind proxy I use cntlm as well as this proxy requires PassNTLM auth.

.apmrc
```
config=https-proxy
strict-ssl=false
registry=http://registry.npmjs.org/
http-proxy=http://127.0.0.1:3128
https-proxy=http://127.0.0.1:3128
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
proxy=http://127.0.0.1:3128


put that config file in your `.atom` sibling directory. Proxy will be respected and you'll be able to use "portable" atom. 

This basically destroys Portable mode as its not portable anymore. Also electonUserData hangs Atom but that was referenced in some other ticket.

Since apm has to be run from its `bin` directory in portable Atom folder open a console and temporarly set ATOM_HOME var. ([Request] apm should do this by itself if run from portable install) 

SET ATOM_HOME=x:\atom.atom
apm install
```

This should be put into Potable mode documentation.

Although apm can be used by setting ATOM_HOME manually, it would make sense that it will work without having to do this manually when using the built in portable mode of Atom which doesn't require setting ATOM_HOME. This likely means apm will have to replicate the portable mode logic from Atom.

Was this page helpful?
3 / 5 - 1 ratings

Related issues

probonopd picture probonopd  Â·  7Comments

michaelsanford picture michaelsanford  Â·  4Comments

fcurts picture fcurts  Â·  7Comments

entozoon picture entozoon  Â·  7Comments

lexicalunit picture lexicalunit  Â·  9Comments