Running Processing sketches in the Atom editor - processing

I am trying to use the Atom text editor for Processing development in Windows, and am having some issues. Internet restrictions at work mean I cannot use the built-in package manager within Atom:
Fetching featured packages failed: connect ECONNREFUSED
Therefore, I need to install packages manually. I am trying to use bleikamp's Processing package for atom which allows the running of processing sketches, and have unzipped the package, downloaded from github, in the packages folder - C:\Users\my_username\.atom\packages.
The package is detected within Atom as being installed, but when I try and run a sketch, the below error occurs:
Failed to activate the processing package
Cannot find module 'ps-tree'
Error: Cannot find module 'ps-tree'
at Module._resolveFilename (module.js:455:15)
at Module._resolveFilename (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._resolveFilename (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\module-cache.js:383:52)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\native-compile-cache.js:50:27)
at Object.<anonymous> (file:///C:/Users/chris.hamilton/.atom/packages/processing-master/lib/processing.coffee:4:10)
at Object.<anonymous> (file:///C:/Users/chris.hamilton/.atom/packages/processing-master/lib/processing.coffee:1:1)
at Module._compile (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\native-compile-cache.js:109:30)
at Object.value [as .coffee] (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\compile-cache.js:216:21)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\native-compile-cache.js:50:27)
at Package.module.exports.Package.requireMainModule (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\package.js:796:27)
at Package.module.exports.Package.activateNow (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\package.js:207:16)
at C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\package.js:876:25
at Function.module.exports.Emitter.simpleDispatch (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:129:28)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\command-registry.js:240:20)
at C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\command-registry.js:3:59
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:599:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:390:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\window-event-handler.js:106:36)
at HTMLDocument.<anonymous> (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\window-event-handler.js:3:59)
I assume this is an issue with dependencies and I am probably missing a step in manually installing the package - can anyone offer any guidance? I have researched fairly extensively into manually installing packages, and there is a lot of information about using commands such as apm link and apm install, but I can't seem to access these commands.
EDIT: I have included processing-java in my PATH variable. Below is the output when path is called from cmd:
PATH=C:\Perl64\site\bin;C:\Perl64\bin;C:\ProgramData\Oracle\Java\javapath;C:\WIN
DOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPow
erShell\v1.0\;C:\Program Files (x86)\Microsoft Office\Office14\;C:\Program Files
(x86)\Enterprise Vault\EVClient\;C:\Program Files\Hummingbird\Connectivity\14.0
0\NFS Maestro\;C:\Program Files (x86)\Hummingbird\Connectivity\14.00\NFS Maestro
\;C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v713\runtime\win32;C:\WI
NDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Autodesk Sh
ared\;C:\Program Files\MATLAB\MATLAB Runtime\v90\runtime\win64;C:\Program Files\
TortoiseSVN\bin;C:\ChrisHamilton\Room_Results_Comparison\processing-3.2.1\;C:\Us
ers\chris.hamilton\AppData\Local\atom\bin
Any help would be much appreciated.

As you have guessed already, missing package dependencies are causing this error. Since you don't seem to have internet connection (or limited connection) at work, I'd recommend installing the Processing package where you are online (e.g. at home), then compress the processing folder and extract it inside the Atom packages folder at work. Make sure the processing folder includes node_modules. Optionally repeat those steps for the script package.
Dependencies are installed running apm install (or npm install) inside the package folder. Whenever an Atom package has dependencies, this step is essential. Atom (or apm) are doing this automatically.
To give you some more insights into the process, here's an alternative way to install a package with dependencies:
cd %USERPROFILE%.atom\packages
git clone https://github.com/bleikamp/processing
cd processing
npm install

It looks like you're running Windows and processing-java hasn't been added to your PATH. Try the following:
Open Advanced System Settings either by running sysdm.cpl or searching in Control Panel.
Click the Environment Variable button on the Advanced tab.
Edit the PATH variable to include the Processing directory (e.g. C:\Program Files\Processing-3.1.1\) in either the User variables (for just your account) or System variables (for all users).
Also note that bleikamp no longer maintains his Processing package and instead recommends using Script.

Related

How to fix library dependence in a conan package

I am trying to install qt/5.14.2 with conan.
Using
qt/5.14.2#bincrafters/stable
I receive
ERROR: libpq/11.5: Error in package_info() method, line 211
self.cpp_info.components["pq"].requires.append("zlib::zlib")
AttributeError: 'Component' object has no attribute 'requires'
OK, there is a bug in libpq/11.5
I am trying to downgrade to
libpq/11.4#bincrafters/stable
ERROR: Conflict in qt/5.14.2#bincrafters/stable:
'qt/5.14.2#bincrafters/stable' requires 'zlib/1.2.11' while 'libpq/11.4#bincrafters/stable' requires 'zlib/1.2.11#conan/stable'.
To fix this conflict you need to override the package 'zlib' in your root package.
BTW:
Why is it not enough to require the correct version of the library, and requiring the same repository? (and require two different repositories in two different packages for the same dependence)
OK, I attempted
zlib/1.2.11#bincrafters/stable
WARN: libpq/11.4#bincrafters/stable: requirement zlib/1.2.11#conan/stable overridden by your conanfile to zlib/1.2.11#bincrafters/stable
zlib/1.2.11#bincrafters/stable: Not found in local cache, looking in remotes...
zlib/1.2.11#bincrafters/stable: Trying with 'conan-center'...
zlib/1.2.11#bincrafters/stable: Trying with 'minres'...
zlib/1.2.11#bincrafters/stable: Trying with 'bincrafters'...
ERROR: Failed requirement 'zlib/1.2.11#bincrafters/stable' from 'libpq/11.4#bincrafters/stable'
ERROR: Unable to find 'zlib/1.2.11#bincrafters/stable' in remotes
Finally, I arrived at
libpq/11.4#bincrafters/stable
zlib/1.2.11#conan/stable
qt/5.14.2#bincrafters/stable
After this, it looks like it was oK:
Installing (downloading, building) binaries...
qt/5.14.2#bincrafters/stable: Retrieving package 93c70de10405da9f2d5a1f42b8c299ca7af869d2 from remote 'bincrafters'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
....qt/5.14.2#bincrafters/stable: Package installed 93c70de10405da9f2d5a1f42b8c299ca7af869d2
qt/5.14.2#bincrafters/stable: Downloaded package revision 0
However, the install fails with
CMake was unable to find Qt5, put qmake in your path or set
QTDIR/QT_QMAKE_EXECUTABLE.
The package is downloaded, I see all components in the corresponding subdirectory in my home directory. However, unlike the other components, it is not installed, before CMake attempts to find it.
What do I wrong?
In case of any strange behavior of conan, upgrade! For me, switch 1.24.0 -> 1.28.1 with configs clean up fixed the same problem with libpq/11.5

Installing python Github package error: package directory 'src' does not exist

I am new at installing external Github packages into python.
I successfully cloned a package by running the command
git clone https://github.com/vishnubob/python-midi.git
However, when I ran
python setup.py install
I received the error:
No sequencer available for 'win32' platform.
C:\Python27\lib\site-packages\setuptools\dist.py:341: UserWarning:
Normalizing 'v0.2.3' to '0.2.3'
normalized_version,
running install
running bdist_egg
running egg_info
creating midi.egg-info
writing midi.egg-info\PKG-INFO
writing top-level names to midi.egg-info\top_level.txt
writing dependency_links to midi.egg-info\dependency_links.txt
writing manifest file 'midi.egg-info\SOURCES.txt'
**error: package directory 'src' does not exist**
Is this a directory problem? And is there another approach to install this package (possible via pip)?
The readme on git hub has: "I am extremely interested in supporting OS-X and Win32 sequencers as well, but I need platform expert who can help me. Are you that person? Please contact me if you would like to help."
So it is simply not supported on Win32.

Angular e2e testing without chromedriver

I am working on angular application e2e tests in very closed and secure environment, where it is not allowed to install chromedriver. It is Windows 7 with IE11 installed.
Command:
npm install chromedriver --save-dev
results with:
> chromedriver#2.31.0 install C:\_LocalWorkspace\Projects\SomeProject\node_modules\chromedriver
> node install.js
Downloading https://chromedriver.storage.googleapis.com/2.31/chromedriver_win32.zip
Saving to C:\Users\someuser\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
ChromeDriver installation failed Error with http request: Error: connect ETIMEDOUT 172.217.21.208:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN app#0.0.1 No repository field.
npm ERR! Windows_NT 6.1.7601
What are my options for e2e tests in this circumstances?
EDIT1:
The problem can be described in other words. The environment that I am working in is closed for direct binary downloading. I am working for a client that has such policy and I can not do anything about that. I am also not allowed to install chrome browser so I have to use internet explorer. Therefore, only available webdrivr is iedriver. ( Please correct me if I am wrong )
My main problem is to install all requirements to make protractor works. It is like I have no Internet connection, but just for binaries. Most of the npm dependencies can be installed normally.
Like:
npm instal webdriver-manager which works,
but
node ./node_modules/protractor/bin/webdriver-manager update fails to download these three files:
https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
https://chromedriver.storage.googleapis.com/2.26/chromedriver_win32.zip
https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-win64.zip
I have an option (from the client) to download files in isolated environment let them through security check and then use them. I did that and I have placed those 3 files in SomeProject\node_modules\protractor\node_modules\webdriver-manager\selenium directory.
Then I have tried to run node ./node_modules/protractor/bin/webdriver-manager update again, hoping that it will skip the download and continue with the normal process steps, extracting etc. But it did not, again it failed to download with the same message.
Then I have extracted the zip files manually.
At this point I am not sure, does node ./node_modules/protractor/bin/webdriver-manager update need to do more things than downloading and extracting. Because it has terminated on download, and I did it manually but how can I know what it would do after if the download was successful?
Anyway, I tried npm run e2e command (which is starting my protractor tests) with extracted binaries in place.
The result was:
[13:24:07] I/local - Starting selenium standalone server...
[13:24:07] I/launcher - Running 1 instances of WebDriver
[13:24:11] I/local - Selenium standalone server started at http://53.150.192.128:58001/wd/hub
[13:24:11] E/launcher - The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://sel
enium-release.storage.googleapis.com/index.html
From error message it is clear that I should download the latest version of iedriver from here as it is described here
I have chosen the latest version, currently 3.4
http://selenium-release.storage.googleapis.com/index.html?path=3.4/
that looks like this:
I took the first link IEDriverServer_Win32_3.4.0.zip downloaded it and extract it in SomeProject\node_modules\protractor\node_modules\webdriver-manager\selenium
But the problem with the same error message still exists. Am I placing it in correct target directory? Should I download maybe some other file from the image?
Please advise how can I install iedriever and run protractor tests.
EDIT2:
Also, the problem can be generalized and put like. How to install protractor dependencies by downloading them manually?

"cannot find module" when installing npm modules on windows

I am new to NodeJS. I am trying to use npm on Windows 8.
I have installed using chocolatey, cinst nodejs.install (version 0.10.17). I installed as administrator (and would prefer to run npm as a normal user).
Node itself seems to be working, I can use the REPL to run simple programs.
If I try to install something using npm, I get cannot find module:
> node npm install express
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\Klas\Documents\My Dropbox\mina egna\tech\node\webserver\npm'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
I have read the answers on Nodejs cannot find installed module on Windows? but unfortunately it is still unclear to me what I have to do.
I have tried setting NODE_PATH:
In trying to follow this answer, I have tried setting it to C:\Users\Klas\AppData\Roaming\npm\node_modules (but I had to create both the npm and the subfolder node_modules myself)
I have tried creating a folder c:\node\node_module (according to this advice, even though the installation did not even create a c:\node folder) and setting it to that.
I have tried setting it to C:\Program Files\nodejs\node_modules\npm\node_modules (which did exist after installation)
I have also tried to create a node_modules folder below the current working directory. As I understand it that is where local npm will be installed?
None of these helped. So it seems to me that setting NODE_PATH is not the solution?
Using the -g flag makes no difference (I would prefer not to use it).
I get the same error both as normal user and as administrator (I would prefer to be a normal user).
I get the same error no matter where I execute the command, except when I do it in C:\Program Files\nodejs, where I get
basedir=`dirname "$0"`
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
Not using windows, but I'm pretty sure it's just npm install express on windows too.

Setting up a LESS file watcher in PHPStorm 6 using node.js on Windows?

I'm a recent convert to PHPStorm and absolutely loving it. I'm trying to get the 'File Watcher' to work with my LESS code, and I want it to use the lessc command. I have node.js installed and the command 'lessc' works from the windows command prompt, but it doesn't want to work within PHPStorm.
Here is my configuration for the file watcher:
When the file watcher runs, I get this error appear continuously:
An exception occurred while executing watcher 'LESS'. Watcher is
disabled. Fix it.: Cannot run program
"C:\Users\Jason\AppData\Roaming\npm\lessc" (in directory
"F:\Plan2Share_v1\public\css"): CreateProcess error=193, %1 is not a
valid Win32 application
As soon as I enable the watcher again, it somehow disables and throws me the above error again. I'm very new to node.js and PHPStorm. Any direction on where I might be going wrong would be greatly appreciated.
EDIT: Following #josh3736 's direction. I now get his error in the Run console of PHPStorm.
"C:\Program Files\nodejs\node.exe" C:\Users\Jason\AppData\Roaming\npm\lessc F:\Plan2Share_v1\public\css\style.less
C:\Users\Jason\AppData\Roaming\npm\lessc:2 basedir=`dirname "$0"`
^ SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
That error tells us that PHPStorm is calling CreateProcess, which can only start executables. It cannot run scripts/batch files, which is what lessc is. (PHPStorm would have to use ShellExecute for that.)
To work around this limitation, you'll have to specify the Node installation (C:\Program Files\nodejs\node.exe most likely) as the executable, and the arguments should probably be something like C:\Users\Jason\AppData\Roaming\npm\node_modules\less\bin\lessc $FileName$
Change Program: C:\Users\Jason\AppData\Roaming\npm\lessc.cmd
Change Arguments: --no-color $FileName$
Apply
Image: https://dl.dropboxusercontent.com/u/4287697/2014-09-26_11h25_29.png

Resources