Giter Club home page Giter Club logo

Comments (6)

briemens avatar briemens commented on May 15, 2024

The problem is with cyclic.js and the existsSync function on line 1. Which is not available before node v0.8 (was path.existsSync)

The Watchr library is depending on "typechecker": "~2.0.1", which is now broken on node v0.6.

The change to fs.existsSync is breaking other dependencies at the moment.

Here is a solution for making cyclic.js work again with older versions of node.

try {
    if (require('fs').lstatSync('.git')) {
        require('child_process').spawn(
            'npm',
            ['install', '--force', require('./package.json').name],
            {env: process.env, cwd: process.cwd(), stdio: 'inherit'}
        );
    }
} catch (err) {
    return err;
}

So the problem can be solved by using lstatSync with a try/catch around it. Easy!

I tried path.existsSync as well, but node > 0.6 prints the following warning. (not recommend)

path.existsSync is now called `fs.existsSync`.

Any chance you can fix this minor compatibility issue? Thanks!

from typechecker.

nishantmodak avatar nishantmodak commented on May 15, 2024

+1. Facing the same issue. Would be good to get this compatibility fixed.

from typechecker.

amb26 avatar amb26 commented on May 15, 2024

What is the purpose of this file cyclic.js, and why has it found its way into so many projects?

from typechecker.

balupton avatar balupton commented on May 15, 2024

@amb26 if project A has a development dependency called project B that has a dependency of project A, then that creates a cyclic dependency, which npm will error about, cyclic.js fixes that error.

I'm unsure if newer versions of npm still have this issue.

from typechecker.

balupton avatar balupton commented on May 15, 2024

cyclic.js is maintained by the bevry/base project, https://github.com/bevry/base/blob/master/cyclic.js

TypeChecker will be updated in coming months when it is converted along with our over projects to ES6, and will get this update - details. As it seems this update is only for Node 0.6 from 2013, I don't think this of any urgency.

from typechecker.

balupton avatar balupton commented on May 15, 2024

Removed cyclic.js in v2.1.0, seems npm now handles cyclic dependencies correctly.

from typechecker.

Related Issues (18)

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.