[request] noob installing package dependency


#1

hi all

for a bit of background, i come from design, so im not that much savvy with these new technologies kids use these days. i know enough to keep my head above the water though.
ive long been looking for an editor who would help me keep my code clean (been through espresso, sublime, brackets) and now Atom is steadily growing on me.
one thing that goes right over my head though is installing said dependencies on a mac.

What ive done so far:
i couldnt install the atom-beautify package directly from withing the program, so i downloaded and put it in its proper folder (/.atom/packages) as ive understood with some google-fu

now, however, even when trying to beautify some strictly html document (which i assumed would need no dependencies, like php_beautifier) i am presented with an error

Error: Cannot find module 'lodash'
    at Module._resolveFilename (module.js:351:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app/src/module-cache.js:383:52)
... this goes on for a bit

What im thinking:
ive heard of Homebrew and found an article on how to install node (unrelated but the steps may apply) on OSX

am i on the right track?
would homebrew help me install such dependencies i need to run beautifier?
any and all tips is greatly appreciated.

cheers!


#2

I’m not sure what problem you are seeing, but in general the way to get around this is to use the command apm install atom-beautify while in any directory. I find the command line apm commands are better than using the settings directory.

The situation you are in now can be fixed by going into the atom-beautify directory and entering apm install.


#3

The right solution is not to avoid using the built-in methods, whether Settings View or apm install atom-beautify, but to fix them so that people don’t have to use clunky and complex manual processes.

@bronze, I would delete the hand-installed version of atom-beautify and try installing it from the command-line by:

  1. Closing all instances of Atom
  2. Run apm install atom-beautify
  3. Start Atom again

And to answer your question, no Homebrew would not help with installing the dependencies of an Atom package.


#4

ok, homebrew is out then.
but do i need something for apm?

-bash: apm: command not found

this is practically a new, virgin, laptop.
i used to do some html/php code and check it online after uploading via FTP
remembered about MAMP/AMPPS just recently, so i dont have developer tools installed just yet…

ps: thanks for the help!

EDIT: found someone with the same doubt on stackexchange, figuring out the next steps…
EDIT2: get a (lack of) git error.

npm WARN `git config --get remote.origin.url` returned wrong result (https://github.com/ariya/esprima.git) xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
npm ERR! git clone https://github.com/ariya/esprima.git xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

found a related topic on github which led me to do apm -v.

apm  0.142.0
npm  2.5.1
node 0.10.35
python 2.7.6
git 

at that time, mac shows me a dialog about installing xcode. (notice git without version number, i lebieve, for not being installed.

EDIT3: saw i could install the command line tools without downloading the entire xcode. either by the website or by gcc on the terminal.
after installing, went back trying to install atom-beautify and it worked! now onto php… :slight_smile:


#5

if anyone stumbles on this (hello from the past!), but i got some help from the package author on github.
Basically, my PEAR path wasnt being quite recognized, so:

  • Enable php.ini in /private/etc/php.ini.default, copy it as /private/etc/php.ini
  • add a path line at the bottom of the document include_path=".://path/to/pear/"
  • the pear path can be found by pear config-get php_dir

working as intended right now.
cheers!