Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncp does not work on io.js due to version sniffing #79

Closed
nicks opened this issue Jan 21, 2015 · 7 comments
Closed

ncp does not work on io.js due to version sniffing #79

nicks opened this issue Jan 21, 2015 · 7 comments

Comments

@nicks
Copy link

nicks commented Jan 21, 2015

io.js (https://iojs.org/) has process.version 'v1.0.3'

When it tries to use ncp, ncp runs this check:

const modern = /^v0\.1\d\.\d+/.test(process.version);

https://github.com/AvianFlu/ncp/blob/master/lib/ncp.js#L4

sadly, this identifies io.js as a non-modern version. It picks the wrong 'defer' method, and goes into an infinite loop.

@stefanpenner
Copy link

I believe I also just ran into this, but just to be sure I'll mention my scenario. (if it ends up being issue, I can gladly open another issue)

given the following file structure

folder/app.js
dist/

input/folder -> ../folder
input/foo.js

running

var ncp = require('ncp');

ncp('input', 'dist', {
      dereference: true,
      clobber: true,
      stopOnErr: true,
      limit: 2
    }, function(err, result) {
      console.log(err, result);
    });

also results in 100% CPU.

± % npm version
{ foo: '0.0.0',
  npm: '2.3.0',
  ares: '1.10.0-DEV',
  http_parser: '2.4',
  modules: '42',
  node: '1.0.4',
  openssl: '1.0.1k',
  uv: '1.2.1',
  v8: '4.1.0.12',
  zlib: '1.2.8' }

stefanpenner added a commit to ember-cli/ember-cli that referenced this issue Jan 25, 2015
Turns out ncp, currently doesn’t work in iojs, so we moved to node-copy-dereference

relevant ncp issue: AvianFlu/ncp#79
@shakiba
Copy link

shakiba commented Jan 25, 2015

I have the same issue on io.js/ubuntu, it breaks phantomjs installation script which uses ncp.

@gsklee
Copy link

gsklee commented Jan 26, 2015

Related: uncss/uncss#142

stefanpenner added a commit to ember-cli/ember-cli that referenced this issue Jan 27, 2015
Turns out ncp, currently doesn’t work in iojs, so we moved to node-copy-dereference

relevant ncp issue: AvianFlu/ncp#79
@bajtos
Copy link

bajtos commented Jan 27, 2015

The discussion in #80 proposes to drop support for Node v0.8, remove the no longer needed version sniffer and release ncp@2.0.0.

stefanpenner added a commit to ember-cli/ember-cli that referenced this issue Jan 27, 2015
Turns out ncp, currently doesn’t work in iojs, so we moved to node-copy-dereference

relevant ncp issue: AvianFlu/ncp#79
@domenic
Copy link

domenic commented Jan 27, 2015

OMG classic version-sniffing problems, it's like browsers or if (osVersion[0] === "9") { /* is Windows 95 or Windows 98 */ } all over again.

kielni pushed a commit to kielni/ember-cli that referenced this issue Feb 5, 2015
Turns out ncp, currently doesn’t work in iojs, so we moved to node-copy-dereference

relevant ncp issue: AvianFlu/ncp#79
johanneswuerbach pushed a commit to johanneswuerbach/ember-cli that referenced this issue Feb 9, 2015
Turns out ncp, currently doesn’t work in iojs, so we moved to node-copy-dereference

relevant ncp issue: AvianFlu/ncp#79
@mmalecki
Copy link
Collaborator

Fixed by removing the version check altogether in b920f53. Sorry for the massive delay on this folks.

@mmalecki
Copy link
Collaborator

This was released as v2.0.0 BTW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants