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

Callback not called with node 10.9.0 #147

Closed
no-more opened this issue Aug 20, 2018 · 10 comments
Closed

Callback not called with node 10.9.0 #147

no-more opened this issue Aug 20, 2018 · 10 comments

Comments

@no-more
Copy link

no-more commented Aug 20, 2018

Hello,

I've just upgraded from node 8.9.4 to node 10.9.0 and node-libcurl (1.2.0 -> 1.3.3) does not seems to work anymore.
None of my curl.on('xxx', callback) is trigerred. I even tried with the default example :

var Curl = require('node-libcurl').Curl;
 
var curl = new Curl();
 
curl.setOpt('URL', 'www.google.com');
curl.setOpt('FOLLOWLOCATION', true);
 
curl.on('end', function(statusCode, body, headers) {
 
    console.info(statusCode);
    console.info('---');
    console.info(body.length);
    console.info('---');
    console.info(this.getInfo( 'TOTAL_TIME'));
 
    this.close();
});
 
curl.on('error', curl.close.bind(curl));
curl.perform();

with no more success. There's no error, no timeout. The process just ends without calling the provided callback functions.
Maybe I'm doing something wrong but I don't know what that could be.

Thanks for any help.

@JCMais
Copy link
Owner

JCMais commented Aug 27, 2018

if you change the Node.js version, you need to rebuild the installed native addons, otherwise they are going to mostly crash with a segfault.

@no-more
Copy link
Author

no-more commented Aug 28, 2018

I removed completely my node_modules and lock files before reinstalling them (I think but I'm not sure I even clear the yarn cache before).

Is there another way to force rebuild ?

@JCMais
Copy link
Owner

JCMais commented Aug 28, 2018

what S.O. are you running?

You can build from source, npm install node-libcurl --build-from-source

@no-more
Copy link
Author

no-more commented Aug 28, 2018

Sorry but what is S.O. ?

I have rollback to node 8.9 but I'll try this tomorrow if I can. A full reinstall take me at least 3 hours.

@JCMais
Copy link
Owner

JCMais commented Aug 28, 2018

Operational System, sorry, had it backwards.

@no-more
Copy link
Author

no-more commented Aug 28, 2018

I'm on Windows 10.

@no-more
Copy link
Author

no-more commented Aug 28, 2018

When trying to build from source I have this error:

1461 warn test-tool-package@0.1.1-beta.22 No description
1462 warn test-tool-package@0.1.1-beta.22 No repository field.
1463 verbose stack Error: node-libcurl@1.3.3 install: `node-pre-gyp install --fallback-to-build`
1463 verbose stack Exit status 1
1463 verbose stack     at EventEmitter.<anonymous> (C:\Users\chris\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
1463 verbose stack     at EventEmitter.emit (events.js:182:13)
1463 verbose stack     at ChildProcess.<anonymous> (C:\Users\chris\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
1463 verbose stack     at ChildProcess.emit (events.js:182:13)
1463 verbose stack     at maybeClose (internal/child_process.js:961:16)
1463 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
1464 verbose pkgid node-libcurl@1.3.3
1465 verbose cwd S:\test-tool-package
1466 verbose Windows_NT 10.0.17134
1467 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nomore\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-libcurl" "--build-from-source"
1468 verbose node v10.9.0
1469 verbose npm  v6.4.0
1470 error code ELIFECYCLE
1471 error errno 1
1472 error node-libcurl@1.3.3 install: `node-pre-gyp install --fallback-to-build`
1472 error Exit status 1
1473 error Failed at the node-libcurl@1.3.3 install script.
1473 error This is probably not a problem with npm. There is likely additional logging output above.
1474 verbose exit [ 1, true ]

After upgrading node, I cleared my npm cache, removed node_module and package lock file before doing npm install. The install works but then I don't have the callback with node-curl.
Then I tried to build-from-source with no success.

@JCMais
Copy link
Owner

JCMais commented Aug 29, 2018

can you place the whole log?

@no-more
Copy link
Author

no-more commented Aug 29, 2018

This is the full console log :

PS S:\syscea-tool-package> npm install node-libcurl --build-from-source
npm WARN syscea-tool-package@0.1.1-beta.22 No description
npm WARN syscea-tool-package@0.1.1-beta.22 No repository field.

npm ERR! path S:\syscea-tool-package\node_modules\node-libcurl\node_modules\node-pre-gyp\node_modules\.tar.DELETE\node_modules\.bin
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'S:\syscea-tool-package\node_modules\node-libcurl\node_modules\node-pre-gyp\node_modules\.tar.DELETE\node_modules\.bin' -> 'S:\syscea-tool-package\node_modules\node-libcurl\node_modules\node-pre-gyp\node_modules\tar\node_modules\.bin'
npm ERR!  { [Error: EPERM: operation not permitted, rename 'S:\syscea-tool-package\node_modules\node-libcurl\node_modules\node-pre-gyp\node_modules\.tar.DELETE\node_modules\.bin' -> 'S:\syscea-tool-package\node_modules\node-libcurl\node_modules\node-pre-gyp\node_modules\tar\node_modules\.bin']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, rename 'S:\syscea-tool-package\node_modules\node-libcurl\node_modules\node-pre-gyp\node_modules\.tar.DELETE\node_modules\.bin' -> 'S:\syscea-tool-package\node_modules\node-libcurl\node_modules\node-pre-gyp\node_modules\tar\node_modules\.bin'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'rename',
npm ERR!      path:
npm ERR!       'S:\\syscea-tool-package\\node_modules\\node-libcurl\\node_modules\\node-pre-gyp\\node_modules\\.tar.DELETE\\node_modules\\.bin',
npm ERR!      dest:
npm ERR!       'S:\\syscea-tool-package\\node_modules\\node-libcurl\\node_modules\\node-pre-gyp\\node_modules\\tar\\node_modules\\.bin' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, rename \'S:\\syscea-tool-package\\node_modules\\node-libcurl\\node_modules\\node-pre-gyp\\node_modules\\.tar.DELETE\\node_modules\\.bin\' -> \'S:\\syscea-tool-package\\node_modules\\node-libcurl\\node_modules\\node-pre-gyp\\node_modules\\tar\\node_modules\\.bin\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path:
npm ERR!    'S:\\syscea-tool-package\\node_modules\\node-libcurl\\node_modules\\node-pre-gyp\\node_modules\\.tar.DELETE\\node_modules\\.bin',
npm ERR!   dest:
npm ERR!    'S:\\syscea-tool-package\\node_modules\\node-libcurl\\node_modules\\node-pre-gyp\\node_modules\\tar\\node_modules\\.bin',
npm ERR!   parent: 'node-pre-gyp' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\chris\AppData\Roaming\npm-cache\_logs\2018-08-29T06_15_28_870Z-debug.log

and this is the node log file :
2018-08-29T06_15_28_870Z-debug.log

@JCMais
Copy link
Owner

JCMais commented May 20, 2019

This should be fixed on v2, currently available as node-libcurl@next

@JCMais JCMais closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants