Skip to content
New issue

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

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

Already on GitHub? # to your account

Unable to install node-gyp under node 0.10.x SyntaxError: Use of const in strict mode #1299

Closed
j4y opened this issue Sep 26, 2017 · 4 comments · Fixed by MissSheyni/node-gyp#1

Comments

@j4y
Copy link

j4y commented Sep 26, 2017

  • Node Version: node 0.10.36 and npm 1.4.28
  • Platform: Linux (CentOS 7)
  • Compiler: gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
  • Module: node-gyp@0.10.6
Verbose output (from npm or node-gyp):
gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.6
gyp info using node@0.10.36 | linux | x64

/usr/local/lib/node_modules/node-gyp/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack SyntaxError: Use of const in strict mode.
gyp ERR! stack     at Module._compile (module.js:439:25)
gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
gyp ERR! stack     at Module.load (module.js:356:32)
gyp ERR! stack     at Function.Module._load (module.js:312:12)
gyp ERR! stack     at Module.require (module.js:364:17)
gyp ERR! stack     at require (module.js:380:17)
gyp ERR! stack     at Object.<anonymous> (/usr/local/lib/node_modules/node-gyp/node_modules/request/node_modules/hawk/lib/index.js:5:33)
gyp ERR! stack     at Module._compile (module.js:456:26)
gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
gyp ERR! stack     at Module.load (module.js:356:32)
gyp ERR! System Linux 3.10.0-514.26.2.el7.x86_64
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/licode/erizoAPI
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v0.10.6
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/TooTallNate/node-gyp/issues>

This used to work, but is now failing for us. Any advice on how to proceed would be appreciated. We are trying to run a legacy system, which uses node 0.10.x

If I try to install the latest node-gyp, it displays some warnings:

sudo npm install -g node-gyp
npm WARN engine request@2.82.0: wanted: {"node":">= 4"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine form-data@2.3.1: wanted: {"node":">= 0.12"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine har-validator@5.0.3: wanted: {"node":">=4"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine har-schema@2.0.0: wanted: {"node":">=4"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine sntp@2.0.2: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine cryptiles@3.1.2: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine hoek@4.2.0: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine boom@4.3.1: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine boom@5.2.0: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
npm WARN engine co@4.6.0: wanted: {"iojs":">= 1.0.0","node":">= 0.12.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
/usr/local/bin/node-gyp -> /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js
node-gyp@3.6.2 /usr/local/lib/node_modules/node-gyp
├── rimraf@2.6.2
├── graceful-fs@4.1.11
├── semver@5.3.0
├── osenv@0.1.4 (os-tmpdir@1.0.2, os-homedir@1.0.2)
├── which@1.3.0 (isexe@2.0.0)
├── nopt@3.0.6 (abbrev@1.1.0)
├── minimatch@3.0.4 (brace-expansion@1.1.8)
├── fstream@1.0.11 (inherits@2.0.3)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── glob@7.1.2 (path-is-absolute@1.0.1, inherits@2.0.3, fs.realpath@1.0.0, inflight@1.0.6, once@1.4.0)
├── tar@2.2.1 (inherits@2.0.3, block-stream@0.0.9)
├── npmlog@4.1.2 (set-blocking@2.0.0, console-control-strings@1.1.0, gauge@2.7.4, are-we-there-yet@1.1.4)
└── request@2.82.0 (is-typedarray@1.0.0, oauth-sign@0.8.2, aws-sign2@0.7.0, forever-agent@0.6.1, tunnel-agent@0.6.0, caseless@0.12.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, safe-buffer@5.1.1, extend@3.0.1, aws4@1.6.0, performance-now@2.1.0, uuid@3.1.0, combined-stream@1.0.5, qs@6.5.1, form-data@2.3.1, mime-types@2.1.17, hawk@6.0.2, tough-cookie@2.3.3, http-signature@1.2.0, har-validator@5.0.3)
@bnoordhuis
Copy link
Member

See request/request#2772. I'm afraid there isn't much you can do except install an older version of request manually.

I don't really want to pin the version of request to 2.81.x because that would prevent it from being shared with npm's copy (when node-gyp is bundled with npm - the common case) but maybe we should for now.

@nodejs/node-gyp Thoughts?

@j4y
Copy link
Author

j4y commented Sep 26, 2017

That is a good workaround. thank you. Here is what I'm using now in case it helps someone else.

sudo npm install -g node-gyp@0.10.6 request@2.25.0

@refack
Copy link
Contributor

refack commented Sep 26, 2017

I don't really want to pin the version of request to 2.81.x because that would prevent it from being shared with npm's copy (when node-gyp is bundled with npm - the common case) but maybe we should for now.

npm has pinned request to ~2.81.0 so no problem:
https://github.com/npm/npm/blob/v5.4.0/package.json#L100

refack added a commit that referenced this issue Oct 10, 2017
Required for "node < 4" compatibility and is congruent with `npm`

minimum for passing `npm test` >= 2.9.0
setting < 2.82.0 allows deduping

PR-URL: #1300
Fixes: #1299
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@bnoordhuis
Copy link
Member

Closing, #1300 was merged.

rvagg pushed a commit that referenced this issue Aug 9, 2018
Required for "node < 4" compatibility and is congruent with `npm`

minimum for passing `npm test` >= 2.9.0
setting < 2.82.0 allows deduping

PR-URL: #1300
Fixes: #1299
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
rvagg pushed a commit that referenced this issue Apr 24, 2019
Required for "node < 4" compatibility and is congruent with `npm`

minimum for passing `npm test` >= 2.9.0
setting < 2.82.0 allows deduping

PR-URL: #1300
Fixes: #1299
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants