Giter Club home page Giter Club logo

Comments (14)

SunboX avatar SunboX commented on September 26, 2024 1

I have installed Tortoise SVN & Command Line Tools

svn-spawn

from node-svn-spawn.

omerts avatar omerts commented on September 26, 2024 1

@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.

SunboX avatar SunboX commented on September 26, 2024

Maybe you have to use https://github.com/ForbesLindesay/win-spawn ?

from node-svn-spawn.

ddliu avatar ddliu commented on September 26, 2024

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.

SunboX avatar SunboX commented on September 26, 2024

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.

ddliu avatar ddliu commented on September 26, 2024

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.

omerts avatar omerts commented on September 26, 2024

I am having the same problem, any solutions?

from node-svn-spawn.

ddliu avatar ddliu commented on September 26, 2024

@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.

omerts avatar omerts commented on September 26, 2024

@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.

omerts avatar omerts commented on September 26, 2024

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.

omerts avatar omerts commented on September 26, 2024

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.

ddliu avatar ddliu commented on September 26, 2024

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.

google search

from node-svn-spawn.

ddliu avatar ddliu commented on September 26, 2024

@omerts, yes cwd is path of your local working directory. Will update document later to make it clear.

from node-svn-spawn.

zombinary avatar zombinary commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.