Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing node 6.10.3 as an NPM dependency

Working on projects using the serverless framework to be deployed to AWS Lambda, I'd like to be running the same version of node that is available on AWS Lambda - namely node 6.10.3. Adding that to "engines" has no effect, so I also added it to "dependencies", but installing that dependency always fails:

> [email protected] preinstall /Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/node
> node installArchSpecificPackage

npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected]
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ssterling3/.npm/_logs/2017-09-15T20_58_25_281Z-debug.log
module.js:471
    throw err;
    ^

Error: Cannot find module 'node-darwin-x64/package.json'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.resolve (internal/module.js:27:19)
    at ChildProcess.<anonymous> (/Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/node-bin-setup/index.js:18:27)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: `node installArchSpecificPackage`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ssterling3/.npm/_logs/2017-09-15T20_58_25_350Z-debug.log

This appears to be the relevant portion of the latest log file:

59 silly preinstall [email protected]
60 info lifecycle [email protected]~preinstall: [email protected]
61 verbose lifecycle [email protected]~preinstall: unsafe-perm in lifecycle true
62 verbose lifecycle [email protected]~preinstall: PATH: /opt/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/node/node_modules/.bin:/Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/munki:/Users/ssterling3/bin:/opt/local/bin/:/Users/ssterling3/.npm-global/bin/:/Users/ssterling3/.gem/ruby/2.4.0/bin/
63 verbose lifecycle [email protected]~preinstall: CWD: /Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/node
64 silly lifecycle [email protected]~preinstall: Args: [ '-c', 'node installArchSpecificPackage' ]
65 silly lifecycle [email protected]~preinstall: Returned: code: 1  signal: null
66 info lifecycle [email protected]~preinstall: Failed to exec preinstall script
67 verbose unlock done using /Users/ssterling3/.npm/_locks/staging-9795425667a03fed.lock for /Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/.staging
68 verbose stack Error: [email protected] preinstall: `node installArchSpecificPackage`
68 verbose stack Exit status 1
68 verbose stack     at EventEmitter.<anonymous> (/opt/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
68 verbose stack     at emitTwo (events.js:106:13)
68 verbose stack     at EventEmitter.emit (events.js:191:7)
68 verbose stack     at ChildProcess.<anonymous> (/opt/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
68 verbose stack     at emitTwo (events.js:106:13)
68 verbose stack     at ChildProcess.emit (events.js:191:7)
68 verbose stack     at maybeClose (internal/child_process.js:886:16)
68 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
69 verbose pkgid [email protected]
70 verbose cwd /Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard
71 verbose Darwin 16.7.0
72 verbose argv "/opt/local/bin/node" "/opt/local/bin/npm" "install" "[email protected]"
73 verbose node v6.10.3
74 verbose npm  v5.4.0
75 error code ELIFECYCLE
76 error errno 1
77 error [email protected] preinstall: `node installArchSpecificPackage`
77 error Exit status 1
78 error Failed at the [email protected] preinstall script.
78 error This is probably not a problem with npm. There is likely additional logging output above.
79 verbose exit [ 1, true ]

It looks like it's trying to fetch a platform-specific variant of the package, and the server doesn't have it.

No other dependencies (or devDependencies) are affected.

This is on macOS Sierra 10.12.6 (16G29), with MacPorts 2.4.1, macports nodejs6 @6.10.3_0, and macports npm5 @5.4.0_0.

  • Does npmjs.com really not have the matching version?
  • Is it available from some other source?
  • Is there something I can do to help npmjs.com make it available?
like image 788
ShadSterling Avatar asked Jul 01 '26 00:07

ShadSterling


1 Answers

After contacting the maintainer, npm package [email protected] now exists, which resolves the problem.

(Lambda now also supports node 8.10.0, and the corresponding [email protected] also exists.)

like image 188
ShadSterling Avatar answered Jul 02 '26 14:07

ShadSterling



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!