Package generate problem


Isn’t package generate supposed to create a symlink in the users home packages folder to the location of the actual project folder? I have to manually create a symlink (windows junction) every time I create a package.

Creating your first ATOM package is broken
[CLOSED but not fixed] Help installing package I'm making (apm link bug?)

The Package Generator: Generate Package command is supposed to link the generated package from wherever it is generated into either the ~/.atom/packages directory or the ~/.atom/dev/packages directory, depending on the package-generator.createInDevMode setting.


My create in dev mode has never been enabled and I have no ~/.atom/dev folder.

I guess I’ll try to debug Generate Package.


I put some debug statements in Generate Package and I’ve found that it is the apm command that isn’t working. I got this command from Generate Package while it ran and then I ran it in a console and even though it looks successful no link was created …

C:\apps\coffee-trace>c:\Chocolatey\lib\atom.0.124.0\tools\atom\resources\app\apm\node_modules\atom-package-manager\bin\apm.cmd link c:\apps\sdfghjkl
C:\Users\Administrator\.atom\packages\sdfghjkl -> c:\apps\sdfghjkl


Can you try to run this command and paste what the output is?

mklink /d C:\Users\Administrator\.atom\packages\sdfghjkl c:\apps\sdfghjkl


symbolic link created for C:\Users\Administrator.atom\packages\sdfghjkl <<===>> c:\apps\sdfghjkl

The link is there now which is no surprise since this is what I’ve been doing to fix the problem.

[CLOSED but not fixed] Help installing package I'm making (apm link bug?)

Same problem? Similar problem? [CLOSED but not fixed] Help installing package I'm making (apm link bug?)

C:\Users\Isaiah\.atom\packages>mklink /d C:\Users\Isaiah\Code\GitHub\atom-jspaint paint
Cannot create a file when that file already exists.

C:\Users\Isaiah\.atom\packages>rm paint
rm: cannot remove `paint': No such file or directory



apm link just doesn’t work on windows:


That sucks. It is really going to frustrate beginners.


Maybe there should be a sticky post about how to create a project on windows until this is fixed.


The reason I was asking what the output was is because there is this bit of code in apm:

When you call apm link, this is ultimately what is called to do the job. As you’ll notice, theoretically if the command is running on Win32, it should call the mklink command I gave you. So that command is failing for some reason when run under apm?


The commands and output you put in your post isn’t a surprise, you’ve reversed the parameters. If you notice in my example (that @mark_hahn confirmed works), the first parameter is the link and the second parameter is the target:


Right, I was sort of wondering why I got a different output that time. I had run it before and gotten a similar permission error
Edit: symbolic link created


Or maybe it isn’t even making it to that point. I’ll debug all the way down into fs.


I chased it to the point where it starts a subprocess. Any idea how to debug the subprocess?

    this.process = ChildProcess.spawn(process.env.comspec || 'cmd.exe', cmdArgs, cmdOptions);

  0: "/s"
  1: "/c"
  2: ""c:\Chocolatey\lib\atom.0.124.0\tools\atom\resources\app\apm\node_modules\atom-package-manager\bin\apm.cmd "link" "c:\apps\my-package"""


I thought it was starting it with runas here … Where is that?

To debug cmd.exe I suppose you would have to pass it parameters to keep it open and/or add extra statements…


mklink /D requires to be under elevated shell, while mklink /J does not…

You could check this fix if you would go and edit the corresponding line in %ProgramData%\chocolatey\lib\Atom.0.125.0\tools\Atom\resources\app\apm\node_modules\atom-package-manager\lib\fs.js


I don’t use Windows, so I can’t check the fix. But perhaps someone else can :grinning:


I tried your patch and it didn’t work. This is not a surprise to me since I always run as administrator and I am always at max privileges.

On an unrelated note: I just saw something weird in windows. The links I created manually with the junction command show up in explorer with the arrow in the icon but the ones created by apm don’t have the arrow. But the properties dialog is identical for each link. I guess a quirk in windows is not exactly big news.


This seems like it would be easy to fix since the problem just appeared around version 120 or so.

Edit: And I still think there should be a sticky post telling newcomers how to make a new project that works. It would give a really bad impression of Atom when the very first thing the instructions say to do doesn’t work.