Comments (14)
I have installed Tortoise SVN & Command Line Tools
from node-svn-spawn.
@ddliu, it ended up being that I was using a remote directory as my current working directory (cwd), figures spawn cmd doesn't work with it.
from node-svn-spawn.
Maybe you have to use https://github.com/ForbesLindesay/win-spawn ?
from node-svn-spawn.
Try typing svn
in cmd.
It requires the svn command, do you have it installed ?
You can follow this link to install it.
from node-svn-spawn.
This works for me:
function cmd_exec(cmd, args, cb_stdout, cb_end) {
var spawn = require('child_process').spawn,
child = spawn(cmd, args, { cwd: 'D:/Work/Foo' }),
me = this;
me.exit = 0; // Send a cb to set 1 when cmd exits
child.stdout.on('data', function (data) { cb_stdout(me, data) });
child.stdout.on('end', function () { cb_end(me) });
}
foo = new cmd_exec('svn', ['log'],
function (me, data) { me.stdout += data.toString(); },
function (me) { me.exit = 1; }
);
function log_console() {
console.log(foo.stdout);
}
// wait 0.25 seconds and print the output
setTimeout(log_console, 250);
from node-svn-spawn.
Interesting, I have been using this library in several projects under Windows without any problem.
Could you please show me some code so that I can reproduce the issue?
from node-svn-spawn.
I am having the same problem, any solutions?
from node-svn-spawn.
@omerts , I can not reproduce under Windows XP nor Windows 7, could you please show me your code?
By the way, what's your environment: OS, svn version, nodejs version?
from node-svn-spawn.
@ddliu Thanks for the response.
This is the code (I omitted the real path, username and pass):
var SvnClient = require('svn-spawn');
var client = new SvnClient({
cwd: 'path',
username: 'username',
password: 'pass'
});
// Also tried providing the path to the list cmd
client.cmd(['list'], function(err, data) {
console.log(err);
console.log(data);
});
OS: Windows 7 professional SP1 64bit
SVN: I tried both TortoiseSVN and SlikSVN, in both cases using list cmd from cmd line worked fine.
Currently using SlikSVN, with the following version:
svn, version 1.8.11-SlikSvn-1.8.11-X64 (SlikSvn/1.8.11) X64
compiled Dec 9 2014, 13:44:31 on x86_64-microsoft-windows6.2.9200
Node Version: v0.10.35
Error:
{ [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }
undefined
{ [Error] code: -1, output: '' }
undefined
from node-svn-spawn.
After updating to Node v0.12.0, the error changed to the following:
{ [Error: spawn svn ENOENT]
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn svn',
path: 'svn' }
undefined
{ [Error] code: -4058, output: '' }
undefined
from node-svn-spawn.
Ok I think I found the problem. It looks like it is in easy-spawn's wrapped spawn function. I am using an https:// url, which seems to be the cause. Using a local svn repository works fine.
from node-svn-spawn.
Could you please try to specify the program path?
program: "absolute path to svn.exe"
There might be something wrong with spawn under 64bit windows. Have to find a 64bit win7 to reproduce it.
from node-svn-spawn.
@omerts, yes cwd is path of your local working directory. Will update document later to make it clear.
from node-svn-spawn.
rerun TortoiseSVN-1.9.7.27907-x64-svn-1.9.7.msi and install the command line tool only,
fix the problem.
node -v --> 8.9.4 | npm -v --> 5.6.7 | win7 64bit
from node-svn-spawn.
Related Issues (13)
- Unable to get the data from svn url HOT 6
- how to get the revision number of a file? HOT 1
- Support multiple files HOT 5
- Should throw error if `svn` CLI is not installed HOT 3
- duplicated results for svn ls HOT 1
- Adding multiple files inside a folder HOT 4
- addlocal error HOT 4
- Does it support command like 'svn co ***url*** --quiet'? HOT 1
- what is the fucntion getlog callback Character encoding? HOT 3
- Not working on Debian 7.11 on a Beagle Bone Black
- Unable to connect to a repository at URL
- cannot ignore stdio
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-svn-spawn.