How to install npm packages in Atom? - wordpress

I'm trying to add WordPress Coding Standards to ESLint in Atom. Unfortunately there are no package I could add via Atom's installer. I've found one (I think) suitable package here but whenever I try to install it using Windows CMD or XAMPP shell I get "npm is ot recognized as internal or external command". I installed ESLint for Atom, so I've got the prerequisite met. Is it possible to add it to Atom on Windows at all?
Cheers, best regards.

Ok,
I digged into the topic and pparently I didn't have Node.js installed so I couldn't manage any npm packages. After installing Node.js I was able to install WordPress-Coding-Standards. Unfortunately I installed the wrong package at first, which was eslint-plugin-wordpress. After trying to set it up eslint started giving me plenty of errors. Then I found out (with a little help from guys on Github) that there are other WordPress Coding Standards plugin for eslint - eslint-config-wordpress which I installed as well. Now everything works like a charm. It's good to learn something new everyday.
Thanks, Dan.
EDIT
Now above packages are deprecated, use #wordpress/eslint-plugin

Related

Installing ada libraries from github -- to keep getting file not found error

This is such a noddy question, but I'm struggling to particularly install libadalang which (to avoid X-Y problem) came from me having a working Gnatstudio, installing ada webserver, then I couldn't start Gnatstudio as it required libadalang.so. So I tried to install libadalang and
am currently getting failures of the form
libadalang-iterators-extensions.ads:29:29: file "langkit_support-symbols-precomputed.ads" not found
So I've spammed my /opt/GNAT/2020 with installing langkit everywhere that looks likely.
./lib/langkit_support
./lib/lib/langkit_support
./lib/include/langkit_support
./include/langkit_support
And still the installer for libadalang doesn't work.
Clearly something going on with paths here that I'm not getting. Can anyone provide any information on how paths are supposed to work as I need to install a number of other ada and SPARK-ada libraries from github and I want to do it correctly.
I think, the simplest way to restore GNAT Studio is to delete everything and reinstall. The GNAT Studio has its-own copy of libadalang/langkit. Look for
<install-path>/lib/gnatstudio/libadalang.so
<install-path>/lib/gnatstudio/liblangkit_support.so
When you install a developer version of libadalang you will get another copy of these files. They could have a different version.
I would suggest you to install GNAT Studio into a dedicated directory and make sure you launch it with a shell script from the bin (bin/gnatstudio). This way it shouldn't be affected by any other installed libraries.
Installing AWS shouldn't break GNAT Studio installation. If you know how to reproduce, please report to AdaCore.

How to compile LESS to CSS with Sublime without npm and node.js?

Our team is starting to use LESS to write CSS. I am using atom.io and there is a plugin to auto-compile LESS to CSS on save. (Link to plugin) However, some team member prefer to use sublime. While there are also similar plugin for sublime, it requires npm for installation. Our team mainly use PHP with composer for package management, so installing npm just for a plugin seems a bit overkill. Is there any other way to do LESS auto-compile on save with sublime?
Not that I know... :(
There is a python library that compiles less to css. (sublime plugin are written in python) though
So, all you've got to do is: write this plugin using lesspy
If you are a bit patient, I am trying to make this plugin, it shouldn't be to hard, I'll keep you in touch.
Matt
EDIT: Here's the plugin: st-py-less. Follow the (simple) instructions to install it. Only working with Sublime Text 3.
They could probably use SublimeOnSaveBuild
But npm and Composer aren't really comparable here. Composer manages a project's dependencies, npm provides easy access to hundreds of thousands of community-maintained packages. Using Composer isn't a reason to not install npm.
And the package you install when you "install npm" is under 14MB. It also comes included with Node.js. The "Installation Requirements" for sublime-less2css, by listing "install node" and "install npm" as two separate steps are misleading, and the provided links aren't that helpful. Here's the official documentation for Installing Node.js and updating npm
This is getting beyond the scope of your question, but to have a single team-wide editor-agnostic setup for automatically compiling LESS to CSS you could use Gulp. If you aren't familiar with Gulp, follow CSS-Tricks' Gulp for Beginners from the start up through the "Watching Sass files for changes" step. (Note that the guide teaches you how to use gulp-sass to compile Sass to CSS; in your case you'd just use gulp-less instead.)

Wordpress plugin install fail

Today I am starting a new project and I am stuck on wordpress plugins installation
Downloading install package from
https://downloads.wordpress.org/plugin/types.1.8.11.zip…
Unpacking the package…
Installing the plugin…
The package could not be installed. No valid plugins were found.
Plugin install failed.`
I ve tried different plugins and all of them produce this error! any ideas?
you can use class-tgm-plugin-activation to install your plugin automatically at your theme
visit and download, https://github.com/TGMPA/TGM-Plugin-Activation
include at your functions
I managed to sucessfully install and activate it, right now. I used wp-cli, but that should not make much difference. I can recommend it though, as it is more verbose, which helps tracking down errors
What is the result of
ls -l .../path/to/wordpress/wp-content/plugins
Assuming you are on Linux/Unix. Do the other plugins have different permissions/users?

Meteor: How do you exactly install phantomJS?

There isn't a clear guide on how to install Phantom for Meteor, so I decided to ask a question to clarify things.
Do you have to install phantom binary in /usr/local/bin/? I downloaded a compiled phantomjs from the official website and placed inside the above path. I can run phantomjs from anywhere now because it's added to path.
In addition to 1, do you also have to install it from meteor npm? I followed this to install "phantomjs": "1.9.13" as a npm package inside my Meteor app. It gets confusing from here because the binary from the official website is v2.0.0 while the npm package is 1.9.13. Do I need to install both?
Because of the confusion in 2, I removed /usr/local/bin/phantomjs but then I can't run $phantomjs anywhere because I don't have anything in PATH.
My ultimate goal is to get spiderable working. What should I do?
Okay, the problem was the compiled phantomjs binary from the official webpage cannot be used right away in the latest Mac OS, but you have to unpack it first. To run spiderable package you don't need to do anything other than placing the binary file phantomjs inside your local path /usr/bin/local/. You can test this by running $phantomjs in your terminal. If you see phantomjs not found then you haven't installed it. If you see an error killed 9 then you have the same problem as mine, and you can solve it by following this.
You do not need the meteorhacks:npm package.
You can do this in two ways:
Method 1:
If you'd like to be able to use PhantomJS via your Meteor app, you would need to use the Meteorhacks NPM package and use the latest NPM version 1.9.16 I believe.
After that, you can edit your packages.json file to add "phantomjs": "1.9.16", and then reference it via var phantomjs = Meteor.npmRequire('phantomjs');
Method 2:
Alternatively, you can use the smart package for Meteor PhantomJS and give that a shot.
I personally feel like Method 1 is a better option, as that worked for me. I needed PhantomJS for an app, and that solution worked for me. I haven't tried Method 2 so I can't speak for it, but it looks promising as well.
Give them a shot, and let me know how it goes. Hope that helps!
Here is a phantomjs wrapper package from atmosphere: https://atmospherejs.com/gadicohen/phantomjs
More importantly here is the spiderable package:
https://atmospherejs.com/meteor/spiderable
I couldn't really answer the questions but more so point ya in a direction that I hope will solve your problem :)
In the terminal:
$ meteor npm install --save phantomjs
In your_meteor_app/server/main.js file (or wherever, provided it's server-side)
import phantom from 'phantom'
Just use npm:
//Global effect on your machine
npm install -g phantomjs
//Test if installed
npm list -g
//Test spiderable working correctly
Test spiderable

How to install Symfony2-plugin into Aptana

I am using Aptana 3.4.2 and want to get Symfony2-plugin into Aptana. But if I try to install the plugin it says that org.eclipse.emf.ecore.feature.group is missing. So if I try to install this package (http://download.eclipse.org/technology/dltk/updates/) it will say that something else is missing.
So I need to install this Symfony2-plugin. How can I get it into Aptana?
There doesn't seem to be any official support for Symfony 2 on Aptana, however this might be of help; you can use the aptana plugin on top of eclipse; however that also has a couple of incompatibilities. Probably worth considering an IDE such as NetBeans or PHPStorm, or using Aptana solely as an editor.

Resources