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

Installing node v5.2.0 .node-gyp v3.0.3 latest version will not install behind proxy. Works with 0.12. #845

Closed
wyattbiker opened this issue Dec 23, 2015 · 6 comments

Comments

@wyattbiker
Copy link

Cannot install modules with node v5.2.0 .node-gyp v3.0.3 behind the proxy with my configurations below. I've tried setting strict-ssl=false. same issue.

This same configuration/installation works perfect with 0.12 of node/npm 2.xxx.. Please help! I am stuck.

$> npm i ws

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1058:38)
gyp ERR! stack     at emitNone (events.js:68:13)
gyp ERR! stack     at TLSSocket.emit (events.js:167:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:597:8)
gyp ERR! System Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "/mnt/node/bin/node" "/mnt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/myapp/strophe/node_modules/bufferutil
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1058:38)
gyp ERR! stack     at emitNone (events.js:68:13)
gyp ERR! stack     at TLSSocket.emit (events.js:167:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:597:8)
gyp ERR! System Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "/mnt/node/bin/node" "/mnt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/myapp/strophe/node_modules/utf-8-validate
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
npm WARN ENOENT ENOENT: no such file or directory, open '/mnt/myapp/strophe/package.json'
npm WARN EPACKAGEJSON strophe No description
npm WARN EPACKAGEJSON strophe No repository field.
npm WARN EPACKAGEJSON strophe No README data
npm WARN EPACKAGEJSON strophe No license field.

===========================================================================================================
$> npm config edit

version=false
proxy=http://myuser:[email protected]:8080/
https-proxy=http://myuser:[email protected]:8080/
strict-ssl=true
registry=http://registry.npmjs.org/
cache=/home/myuser/.npm
@wyattbiker
Copy link
Author

Any answers to this?
Ever since 4 and 5 I have not been able to find a workaround when gyp is required. I've tried NODE_TLS_REJECT_UNAUTHORIZED=0 and that does't help. I have set strict-ssl to false. No good. Does node-gyp respect the npm settings? I don't understand why this is so complicated.

My project is in danger now because company is not going to change their proxies and firewalls for me.
Any other solutions to install without using gyp? Rolling back to 0.12 will not do because one of the important node modules requires v5.

@bnoordhuis
Copy link
Member

Does node-gyp respect the npm settings?

Not really, although the next release will respect the cafile setting if present. Adding a heuristic for strict-ssl might be acceptable but I'm leaning towards not doing that; people will set it, forget it, and leave themselves vulnerable.

Any other solutions to install without using gyp?

node-gyp tries to download the SDK from nodejs.org. If it can't punch through your firewall, download the appropriate source tarball from https://nodejs.org/dist/ and point npm / node-gyp to it with the --nodedir switch or the npm_config_nodedir environment variable.

EDIT:

This same configuration/installation works perfect with 0.12 of node/npm 2.xxx..

That suggests your proxy uses e.g. 1024 bits certificates or an outdated cipher; v0.12 accepts those, v4.x and v5.x do not. openssl s_client -connect <host>:<port> will tell you.

@wyattbiker
Copy link
Author

I am using node v4 for now. As per your suggestion I downloaded node v4 tarball and tried installing and get the error below. Am I missing a step? --Thanks!

 $ npm i node-strophe --nodedir=/mnt/ocwsc/castest/node-v4.2.3-linux-x64.tar.gz
> [email protected] install /mnt/ocwsc/strophe/node_modules/node-strophe/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

gyp: /mnt/ocwsc/castest/node-v4.2.3-linux-x64.tar.gz/common.gypi not found (cwd: /mnt/ocwsc/strophe/node_modules/node-strophe/node_modules/jsdom/node_modules/contextify) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/mnt/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "/mnt/node/bin/node" "/mnt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/ocwsc/strophe/node_modules/node-strophe/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules/node-strophe
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected])

@wyattbiker
Copy link
Author

Ok, changed to command to the one below. Looks like contextify has issue. (I even upgraded node to version 5 of node and reinstalled node-gyp). Do I need to also do something else?

 $ npm i node-strophe --nodedir=/mnt/node/include/node
> [email protected] install /mnt/ocwsc/strophe/node_modules/contextify
> node-gyp rebuild

make: Entering directory `/mnt/ocwsc/strophe/node_modules/contextify/build'
  CXX(target) Release/obj.target/contextify/src/contextify.o
../src/contextify.cc:1:18: error: node.h: No such file or directory
../src/contextify.cc:2:26: error: node_version.h: No such file or directory
In file included from ../src/contextify.cc:3:
../../nan/nan.h:44:16: warning: uv.h: No such file or directory
../../nan/nan.h:46:25: warning: node_buffer.h: No such file or directory
../../nan/nan.h:47:30: warning: node_object_wrap.h: No such file or directory
In file included from ../src/contextify.cc:3:
../../nan/nan.h:140: error: ‘v8’ has not been declared
../../nan/nan.h:140: error: expected initializer before ‘<’ token
In file included from ../../nan/nan.h:150,
                 from ../src/contextify.cc:3:
../../nan/nan_callbacks.h:16: error: ‘v8’ was not declared in this scope
../../nan/nan_callbacks.h:16: error: template argument 1 is invalid
../../nan/nan_callbacks.h:18: error: typedef ‘Nan::GetterCallback’ is initialized (use decltype instead)

more here ......


../../nan/nan_callbacks.h:55: error: ‘v8’ has not been declared
../../nan/nan_callbacks.h:55: error: expected initializer before ‘<’ token
In file included from ../../nan/nan_callbacks.h:85,
                 from ../../nan/nan.h:150,
                 from ../src/contextify.cc:3:
../../nan/nan_callbacks_pre_12_inl.h:18: error: ‘v8’ has not been declared
../../nan/nan_callbacks_pre_12_inl.h:18: error: ISO C++ forbids declaration of ‘Isolate’ with no type
../../nan/nan_callbacks_pre_12_inl.h:18: error: expected ‘;’ before ‘*’ token
../../nan/nan_callbacks_pre_12_inl.h:19: error: ‘v8’ has not been declared
../../nan/nan_callbacks_pre_12_inl.h:19: error: ISO C++ forbids declaration of ‘Persistent’ with no type
../../nan/nan_callbacks_pre_12_inl.h:19: error: expected ‘;’ before ‘<’ token
../../nan/nan_callbacks_pre_12_inl.h:24: error: ‘v8’ has not been declared
../../nan/nan_callbacks_pre_12_inl.h:24: error: expected ‘)’ before ‘*’ token
../../nan/nan_callbacks_pre_12_inl.h:33: error: ISO C++ forbids declaration of ‘v8’ with no type
../../nan/nan_callbacks_pre_12_inl.h:33: error: expected ‘,’ or ‘...’ before ‘::’ token

...more of the same here


../../nan/nan_callbacks_pre_12_inl.h:489: error: ‘v8’ has not been declared
../../nan/nan_callbacks_pre_12_inl.h:489: error: expected initializer before ‘<’ token
../../nan/nan_callbacks_pre_12_inl.h:502: error: ‘v8’ has not been declared
../../nan/nan_callbacks_pre_12_inl.h:502: error: expected initializer before ‘<’ token
In file included from ../src/contextify.cc:3:
../../nan/nan.h:155: error: ‘v8’ has not been declared
../../nan/nan.h:155: error: expected initializer before ‘UnboundScript’
../../nan/nan.h:156: error: ‘v8’ has not been declared
../../nan/nan.h:156: error: expected initializer before ‘BoundScript’
../../nan/nan.h:163: error: ‘v8’ has not been declared
../../nan/nan.h:164: error: expected initializer before ‘ExternalOneByteStringResource’
In file included from ../../nan/nan.h:196,
                 from ../src/contextify.cc:3:
../../nan/nan_maybe_pre_43_inl.h:21: error: ‘v8’ has not been declared
../../nan/nan_maybe_pre_43_inl.h:21: error: expected ‘)’ before ‘<’ token
../../nan/nan_maybe_pre_43_inl.h:28: error: ‘v8’ has not been declared
../../nan/nan_maybe_pre_43_inl.h:28: error: expected primary-expression before ‘>’ token
../../nan/nan_maybe_pre_43_inl.h:28: error: ‘out’ was not declared in this scope
../../nan/nan_maybe_pre_43_inl.h:28: error: ‘ToLocal’ declared as an ‘inline’ field

..more of the same here

../../nan/nan_maybe_pre_43_inl.h:285: error: expected ‘,’ or ‘;’ before ‘{’ token
../../nan/nan_maybe_pre_43_inl.h:289: error: ‘v8’ was not declared in this scope
../../nan/nan_maybe_pre_43_inl.h:289: error: template argument 1 is invalid
../../nan/nan_maybe_pre_43_inl.h:291: error: expected primary-expression before ‘index’
../../nan/nan_maybe_pre_43_inl.h:291: error: initializer expression list treated as compound expression
../../nan/nan_maybe_pre_43_inl.h:291: error: expected ‘,’ or ‘;’ before ‘{’ token
In file included from ../../nan/nan.h:199,
                 from ../src/contextify.cc:3:
../../nan/nan_converters.h:26: error: ‘v8’ was not declared in this scope
../../nan/nan_converters.h:26: error: template argument 1 is invalid
../../nan/nan_converters.h:26: error: ‘v8’ was not declared in this scope
../../nan/nan_converters.h:26: error: template argument 1 is invalid

....more of the same here


../../nan/nan_converters.h:53: error: ‘v8’ has not been declared
../../nan/nan_converters.h:53: error: ‘v8’ has not been declared
../../nan/nan_converters.h:53: error: ‘val’ was not declared in this scope
In file included from ../../nan/nan_converters.h:61,
                 from ../../nan/nan.h:199,
                 from ../src/contextify.cc:3:
../../nan/nan_converters_pre_43_inl.h:18: error: ‘v8’ was not declared in this scope
../../nan/nan_converters_pre_43_inl.h:18: error: template argument 1 is invalid
../../nan/nan_converters_pre_43_inl.h:18: error: expected initializer before ‘imp’
../../nan/nan_converters_pre_43_inl.h:19: error: ‘v8’ was not declared in this scope
../../nan/nan_converters_pre_43_inl.h:19: error: template argument 1 is invalid

...more of the same here

../../nan/nan_converters_pre_43_inl.h:38: error: ‘v8’ has not been declared
../../nan/nan_converters_pre_43_inl.h:38: error: ‘v8’ has not been declared
../../nan/nan_converters_pre_43_inl.h:38: error: ‘val’ was not declared in this scope
../../nan/nan_converters_pre_43_inl.h:38: error: expected ‘,’ or ‘;’ before ‘{’ token
In file included from ../../nan/nan.h:200,
                 from ../src/contextify.cc:3:
../../nan/nan_new.h:15: error: ‘v8’ has not been declared
../../nan/nan_new.h:15: error: expected constructor, destructor, or type conversion before ‘<’ token

...more of the same here....

../../nan/nan_implementation_pre_12_inl.h:84: error: template argument 1 is invalid
../../nan/nan_implementation_pre_12_inl.h:85: error: expected initializer before ‘Factory’
../src/contextify.cc:362: error: expected ‘}’ at end of input
../src/contextify.cc:362: error: expected ‘}’ at end of input
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
make: Leaving directory `/mnt/ocwsc/strophe/node_modules/contextify/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/mnt/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:88:13)
gyp ERR! stack     at ChildProcess.emit (events.js:173:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "/mnt/node/bin/node" "/mnt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/ocwsc/strophe/node_modules/contextify
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
/mnt/ocwsc/strophe
└─┬ [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ └─┬ [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ └─┬ [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   └── [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ └── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ └── [email protected]
  │   ├─┬ [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ ├── [email protected]
  │   │ │ ├── [email protected]
  │   │ │ ├─┬ [email protected]
  │   │ │ │ └── [email protected]
  │   │ │ ├── [email protected]
  │   │ │ └── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ └── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ ├── [email protected]
  │   │ │ ├─┬ [email protected]
  │   │ │ │ └── [email protected]
  │   │ │ ├── [email protected]
  │   │ │ └── [email protected]
  │   │ └─┬ [email protected]
  │   │   └── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ ├── [email protected]
  │   │ ├── [email protected]
  │   │ └── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ ├── [email protected]
  │   │ │ ├── [email protected]
  │   │ │ └── [email protected]
  │   │ └─┬ [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   ├── [email protected]
  │   │   └── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ └── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   └── [email protected]
  └── [email protected]

npm WARN ENOENT ENOENT: no such file or directory, open '/mnt/ocwsc/strophe/package.json'
npm WARN EPACKAGEJSON strophe No description
npm WARN EPACKAGEJSON strophe No repository field.
npm WARN EPACKAGEJSON strophe No README data
npm WARN EPACKAGEJSON strophe No license field.

@bnoordhuis
Copy link
Member

Make sure you download the source tarball, the binaries-only tarball doesn't include the SDK.

Aside, you shouldn't need contextify in v5.x; the module has been integrated into the built-in vm module.

@wyattbiker
Copy link
Author

Contextify is an older jsdom dependency requirement. Changed to newer version which does not have it as dependency and it worked.

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

3 participants