Package generate problem


#1

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?)
#2

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.


#3

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.


#4

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

#5

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

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

#6

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?)
#7

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

???


#8

apm link just doesn’t work on windows: https://github.com/atom/apm/issues/178


#9

That sucks. It is really going to frustrate beginners.


#10

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


#11

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?


#12

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:

http://technet.microsoft.com/en-us/library/cc753194.aspx


#13

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


#14

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


#15

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);

arguments
["C:\WINDOWS\system32\cmd.exe", 
  Array[3]
  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"""

#16

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…


#17

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


#18

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


#19

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.


#20

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.