execSync icon indicating copy to clipboard operation
execSync copied to clipboard

error while 'npm install execSync'

Open tataue opened this issue 10 years ago • 9 comments

Could you please tell me why and how to solve it, tks! here are the message:

npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the execSync package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild

tataue avatar Mar 05 '14 13:03 tataue

bump. any update on this? it still happens on node v0.11.12

> [email protected] install /Users/mozilla/Dropbox/www/nybl/kiwi/node_modules/execSync
> node-gyp rebuild

  CXX(target) Release/obj.target/shell/src/shell.o
../src/shell.cpp:138:26: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> Exec(const Arguments& args) {
                         ^~~~~~~~~
                         v8::internal::Arguments
/Users/mozilla/.node-gyp/0.11.12/deps/v8/include/v8.h:141:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/shell.cpp:139:17: error: calling a private constructor of class 'v8::HandleScope'
    HandleScope scope;
                ^
/Users/mozilla/.node-gyp/0.11.12/deps/v8/include/v8.h:768:13: note: declared private here
  V8_INLINE HandleScope() {}
            ^
../src/shell.cpp:141:13: error: member access into incomplete type 'const v8::internal::Arguments'
    if (args.Length() < 1) {
            ^
/Users/mozilla/.node-gyp/0.11.12/deps/v8/include/v8.h:141:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/shell.cpp:147:29: error: type 'const v8::internal::Arguments' does not provide a subscript operator
    Local<String> str = args[0]->ToString();
                        ~~~~^~
../src/shell.cpp:156:35: error: cannot initialize a parameter of type 'FunctionCallback' (aka 'void (*)(const FunctionCallbackInfo<v8::Value>
      &)') with an lvalue of type 'Handle<v8::Value> (const v8::internal::Arguments &)': type mismatch at 1st parameter
      ('const FunctionCallbackInfo<v8::Value> &' vs 'const v8::internal::Arguments &')
            FunctionTemplate::New(Exec)->GetFunction());
                                  ^~~~
/Users/mozilla/.node-gyp/0.11.12/deps/v8/include/v8.h:3347:24: note: passing argument to parameter 'callback' here
      FunctionCallback callback = 0,
                       ^
5 errors generated.
make: *** [Release/obj.target/shell/src/shell.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/mozilla/.nvm/v0.11.12/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:107:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/Users/mozilla/.nvm/v0.11.12/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mozilla/Dropbox/www/nybl/kiwi/node_modules/execSync
gyp ERR! node -v v0.11.12
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the execSync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls execSync
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.1.0
npm ERR! command "/Users/mozilla/.nvm/v0.11.12/bin/node" "/Users/mozilla/.nvm/v0.11.12/bin/npm" "install" "execSync"
npm ERR! cwd /Users/mozilla/Dropbox/www/nybl/kiwi
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/mozilla/Dropbox/www/nybl/kiwi/npm-debug.log
npm ERR! not ok code 0

smirea avatar Apr 01 '14 12:04 smirea

Just finished moving and starting a new position. Will try to find some time this weekend.

mgutz avatar Apr 01 '14 18:04 mgutz

@mgutz it also affected my Travis CI build. When are you planning to fix that?

This is my build that is failing. It seems that codeclimate reporter is using your execSync and that is failing on node 0.11 . If you need more info please feel free to ask. I would be glad to help You. https://travis-ci.org/zdalniacy/zdalniacy.pl/builds/22646832

galuszkak avatar Apr 09 '14 22:04 galuszkak

:+1:

timoxley avatar Apr 24 '14 06:04 timoxley

Same here!

edlefebvre avatar Apr 25 '14 09:04 edlefebvre

I wish it was possible to conditionally install deps. The execSync module is technically not needed in Node 0.12 since it's natively available there but if we need to stay compatible with Node 0.10, we need to have it in package.json.

@mgutz Perhaps you could just skip compilation in Node >=0.11 and return an object throwing on every invocation with a message to use the pattern:

var execSync = require('child_process').execSync || require('execSync');

?

mgol avatar Jun 23 '14 09:06 mgol

...or even better, just use the native require('child_process').execSync to implement your API in Node >=0.11

mgol avatar Jun 23 '14 09:06 mgol

Hm, actually it seems it's possible to use with npm's optionalDependencies.

Still, my suggestion from the last comment would be useful.

mgol avatar Jun 23 '14 09:06 mgol

@mzgol Aha, thank you! I was just bit by this, and was trying to figure out how to deal with it. I'll set the dependency to Node 0.11, and use the native one. :+1:

Melindrea avatar Jul 11 '14 16:07 Melindrea