Why is this Sublime Text Grunt Build failing in Windows 7? - sublimetext2

Why is this Sublime Text Grunt Build failing in Windows 7?
{
"cmd": ["grunt.cmd", "--no-color"],
"path": "C:\\Users\\USER\\AppData\\Roaming\\npm;C:\\Program/ Files\\nodejs",
"working_dir": "${project_path}"
}
Console says:
'node' is not recognized as an internal or external command, operable program or batch file.
[Finished in 0.1s with exit code 1]

Try the following first:
{
"cmd": ["grunt.cmd", "--no-color"],
"path": "C:/Users/USER/AppData/Roaming/npm;C:/Program\ Files/nodejs",
"working_dir": "${project_path}"
}
If that doesn't work, try removing the \ character between Program and Files. You don't need the "selector" argument at all, as that is used to specify the scope for the build system. ["Gruntfile.js"] is not a valid scope.
As an alternative option, check out the Grunt plugin available via Package Control. I haven't used it myself, but it looks quite useful. It parses your Gruntfile.(js|coffee) file and adds the available tasks to the Command Palette, among other things. It directly reads your PATH variable, so as long as your node and npm directories are there, it should work quite well.

Related

The terminal shell path "..\..\..\vsCode\git\bin\bash.exe" does not exist in VS Code Windows

I am trying to set a portable development Environment:
VS Code - Portable mode
git-bash - portable
Node.js - portable
VS Code throws Error: The terminal shell path "......\vsCode\git\bin\bash.exe" does not exist
I have C:......\Documents\Storage\vsCode\data\user-data\User\settings.json
and C:......\Documents\Storage\vsCode\git\bin\bash.exe
settings.json:
{
// Git Bash
"terminal.integrated.shell.windows": "..\\..\\..\\vsCode\\git\\bin \\bash.exe"
}
It works in CMD:
C:\.........>cd C:\...........\Documents\Storage\vsCode\data\user-data\User
C:\.......\Documents\Storage\vsCode\data\user-data\User>cd ..\..\..\git\bin\
C:\.......\Documents\Storage\vsCode\git\bin>
Can you guide me how to deal with relative path in VS Code without setting global variables in the operating system. I will need to do the same thing with Node.
Sorry for the messy post but I am fairly new to posting here.
You can follow below link :
https://code.visualstudio.com/docs/editor/integrated-terminal
You need to edit the terminal integrated path in settings.json file to which ever thing you want it to compile it with
See the URL in the screenshot to find the location for settings.json file at my end:
I searched for "shell path" in the VS Code settings and noticed that the path was wrong
(Program Files instead of Program Files (x86))
I had to change it to
"terminal.integrated.shell.windows": "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
#Rhatalin thank you for the suggestion. I had the same issue on Windows 10. After updating below setting in settings.json (File -> Preferences -> Settings search for shell and choose Terminal-Integrated-Automation Shell: Windows -> Edit in settings.json) the issue was gone.
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
After a Windows update, I got the same error. I had to add escape \ characters to each backslash in the path to get it to work again. (check your path to make sure each single \ is double \)
This works: "C:\Program Files\Git\bin\bash.exe"
This does not work: "C:\Program Files\Git\bin\bash.exe"

How do I install a driver in Erlang? (Specifically MySQL-otp driver)

From the documentation this driver looks great. I don't know how to install it so that I can use it though. I read somewhere that I should maybe use rebar? I looked at that documentation though and it appears to have the opposite problem. It says how to install it, but not how to use it.
Update
So it looks like after installing rebar, I can add the lines
{deps, [
{mysql, ".*", {git, "https://github.com/mysql-otp/mysql-otp",
{tag, "1.3.3"}}}
]}.
to my file rebar.config. I don't know what this does though. Do I have to compile or make this file now? Does rebar.config have to be in the same directory as my project? Right not the path to rebar.config is ~/rebar/rebar.config
Is it all correct to place my project so that it is a sibling to rebar in the file hierarchy?
Update
I ran ./rebar get-deps with the rebar folder and got
Pulling mysql from {git,"https://github.com/mysql-otp/mysql-otp",
{tag,"1.3.3"}}
Cloning into 'mysql'...
==> mysql (get-deps)
I still don't really know what this means though, and when I try compiling my erlang file I receive the result.
c(erlangFile.erl).
{error,non_existing}
rebar is a build tool for erlang.Please go through https://github.com/rebar/rebar/wiki/Rebar-commands for the commands.
After getting dependency, "rebar compile" is required to compile it.
For using the beam files, you have to give output beam path using Add Path to Erlang Search Path?
these methods.
Then you will be able to use it in your code.
Download your package, in this case
git clone https://github.com/mysql-otp/mysql-otp.git
Download a tool called rebar
git clone git://github.com/rebar/rebar.git
cd rebar
./bootstrap
Add the following to rebar/rebar.config
{deps, [
{mysql, ".*", {git, "https://github.com/mysql-otp/mysql-otp",
{tag, "1.3.3"}}}
]}.
Within the rebar/mysql-otp directory run
./rebar get-deps
Then within the same directory, run
./rebar compile
This will put a bunch of .beam files and .app file into the ebin/ directory
Next add the ebin/ directory to your path. You can update your $ERL_LIBS environment variable, run an include command within the erlang console like
1> code:add_pathz("~/rebar/mysql-otp/ebin").
or
1> code:add_pathz("rebar/mysql-otp/ebin")
And theres a few other ways to add it to your Erlang path.
Also, make sure mysql is also installed
Heres a few links with mysql installation instructions that worked for me
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7
No package msyql-server available

Compiling a program on a server

I'm new to servers and programming in general, and I have a question regarding remote acces to a server, and how much I can actually do on it.
The thin is I have a working program on a linux server, which I acces with my windows machine using mobaxterm. I can acces the server, I see folders and a cmd line, where I can compile a makefile. Everything runs well, however when I run the makefile it just compiles, and doesn't do anything. No error messages, but also no opening of a program. I don't understand anything. Is it a delimitation of the servers structure, that it can only store files on it?
When you compile under linux using a make, it produces an executable but does not run it. Make builds executable objects, but it does not run them. You should include your makefile in the question (reduced to a minimum if it is large). Inside it, you will see that it generates a executable file with a specific name. To run it, you need to invoke this from the command line.
To find out what it is building, a quick way is to type "make clean" (press enter of course) to clean up any built objects. Then type the "ls" command to see what is in your directory.
Next, build the program with the "make" command, then type "ls" to see what has been added. Ignore any new files that end in .o or .a or .so and look for any new files. These are the files built by make and at least one of them is the program you built.
Assuming you found a new file called "myprogram". To run it, type:
./myprogram

How do I extend the $PATH that Sublime Text 2 uses?

I just installed Sublime-jshint (and the requisite node.js + jshint) but get this error when I try to invoke JSHint from within ST2:
[Errno 2] No such file or directory
[cmd: [u'jshint', u'PATH-TO-THE-JS-FILE-I-AM-LINTING', u'--reporter', u'/home/cmg/.config/sublime-text-2/Packages/JSHint/reporter.js']]
[dir: DIR-MY-JS-FILE-IS-IN]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cmg/bin]
[Finished]
The final item in the given path is in the home dir of my user (cmg), so it's been customized somehow... but I don't recall how, so I don't know how to add the dir I need (~/node_modules/.bin).
I've added it to $PATH in my shell (via both .bashrc and .bash_profile) but ST2 doesn't pick it up.
(I'm on Ubuntu 14.04. All the usable stuff I've found via Google on this subject has been either OS X specific or related to ST's build system).
Basically, the exec command, which the jshint package uses internally, allows you to set/extend the PATH of the spawned subprocess. (docs)
The package actually uses this path argument on OSX, but has it hardcoded (I am partly guilty of that as I rewrote the command because it was just horrible before). It should allow for a setting to specify the path to your jshint executable, so I suggest you create an issue for that.
I don't know why ST dosn't pick up your PATH from somewhere else since I have very little experience with that.
Open /etc/profile in Sublime (using sudo) and add the following line at the very bottom:
export PATH=/home/cmg/node_modules/.bin:$PATH
and save the file. Restart completely, and your PATH should be updated.

Sublime Text Build in an external window

Is there a way to create a build command in Sublime Text that opens a new external window (terminal/cmd.exe)? Everything I try gets captured to the built-in output window.
I tried:
{
"cmd": ["ruby", "$file"],
"target": "cmd.exe",
"file_regex": "rb$",
"selector": "source.rb"
}
But nothing happened
The following works for Windows (I've tested it on XP and 7):
{
"cmd": ["start", "cmd", "/k", "c:/ruby193/ruby.exe", "$file"],
"selector": "source.ruby",
"shell": true,
"working_dir": "$file_dir"
}
Save it as Packages/User/Ruby_cmd.sublime-build (you may need to alter the path to the Ruby executable depending on your system), select Tools -> Build System -> Ruby_cmd, and build with CtrlB.
start does what it says it does, start a new process independent of Sublime Text. cmd is cmd.exe, the Windows command-line interpreter. The /k flag keeps the window open (at a new command prompt) after your program has run, allowing you to examine its output, look at tracebacks, run additional commands, etc.
May be you will find this solution helpful:
https://github.com/rctay/sublime-text-2-buildview
(transfers build output in the separate sublime tab, you can then do with it whatever you want)