gpt4 book ai didi

node.js - 将 Node 6.10.3 安装为 NPM 依赖项

转载 作者:搜寻专家 更新时间:2023-10-31 23:51:20 24 4
gpt4 key购买 nike

使用 serverless framework 处理项目部署到 AWS Lambda , 我想运行相同版本的 Node available on AWS Lambda - 即 Node 6.10.3。将其添加到 "engines"没有效果,所以我也加到"dependencies" ,但安装该依赖项总是失败:

> node@6.10.3 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 node-darwin-x64@6.10.3
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! node@6.10.3 preinstall: `node installArchSpecificPackage`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node@6.10.3 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

这似乎是最新日志文件的相关部分:

59 silly preinstall node@6.10.3
60 info lifecycle node@6.10.3~preinstall: node@6.10.3
61 verbose lifecycle node@6.10.3~preinstall: unsafe-perm in lifecycle true
62 verbose lifecycle node@6.10.3~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 node@6.10.3~preinstall: CWD: /Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/node
64 silly lifecycle node@6.10.3~preinstall: Args: [ '-c', 'node installArchSpecificPackage' ]
65 silly lifecycle node@6.10.3~preinstall: Returned: code: 1 signal: null
66 info lifecycle node@6.10.3~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: node@6.10.3 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 node@6.10.3
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" "node@6.10.3"
73 verbose node v6.10.3
74 verbose npm v5.4.0
75 error code ELIFECYCLE
76 error errno 1
77 error node@6.10.3 preinstall: `node installArchSpecificPackage`
77 error Exit status 1
78 error Failed at the node@6.10.3 preinstall script.
78 error This is probably not a problem with npm. There is likely additional logging output above.
79 verbose exit [ 1, true ]

看起来它正在尝试获取包的特定于平台的变体,但服务器没有。

没有其他依赖项(或 devDependencies)受到影响。

这是在 macOS Sierra 10.12.6 (16G29) 上,带有 MacPorts 2.4.1、macports nodejs6 @6.10.3_0 和 macports npm5 @5.4.0_0。

  • 是否npmjs.com真的没有匹配的版本吗?
  • 是否可以从其他来源获得?
  • 有什么我可以帮忙的吗npmjs.com让它可用?

最佳答案

联系维护者后,npm包node-darwin-x64@6.10.3已经存在,问题解决。

(Lambda现在也支持node 8.10.0,对应的node-darwin-x64@8.10.0也存在。)

关于node.js - 将 Node 6.10.3 安装为 NPM 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46247669/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com