【问题标题】:How to install npm openlpr in nodejs如何在 nodejs 中安装 npm openlpr
【发布时间】:2020-07-06 19:41:14
【问题描述】:

我一直在尝试安装 npm node-openalpr 包,但我遇到了这个错误。我该如何克服这个问题?

> node-openalpr@1.1.1 install D:\My Codes\Thesis\node\node_modules\node-openalpr
> node-pre-gyp install --build-from-source --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp ERR! UNCAUGHT EXCEPTION 
node-pre-gyp ERR! stack Error: node-openalpr package.json is not node-pre-gyp ready:
node-pre-gyp ERR! stack package.json must declare these properties: 
node-pre-gyp ERR! stack binary.host
node-pre-gyp ERR! stack     at validate_config (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\versioning.js:220:15)
node-pre-gyp ERR! stack     at Object.module.exports.evaluate (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\versioning.js:279:5)
node-pre-gyp ERR! stack     at handle_gyp_opts (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\handle_gyp_opts.js:60:27)
node-pre-gyp ERR! stack     at configure (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\configure.js:12:5)
node-pre-gyp ERR! stack     at D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\build.js:43:13
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\compile.js:85:9)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Windows_NT 10.0.19041
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\My Codes\\Thesis\\node\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--build-from-source" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\My Codes\Thesis\node\node_modules\node-openalpr
node-pre-gyp ERR! node -v v12.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm WARN final_thesis@1.0.0 No description
npm WARN final_thesis@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! node-openalpr@1.1.1 install: `node-pre-gyp install --build-from-source --fallback-to-build`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the node-openalpr@1.1.1 install 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!     C:\Users\MSI\AppData\Roaming\npm-cache\_logs\2020-07-06T19_34_07_841Z-debug.log

我听说 node-pre-gyp 版本存在问题,因为这个 openalpr 包已经 5 岁了。 我该如何克服这个问题?

【问题讨论】:

    标签: javascript node.js npm openalpr


    【解决方案1】:

    我在 node-openaplr package.json 中注意到 node-pre-gyp 的依赖项指向 node-pre-gyp 存储库,这意味着它将引入最新版本的 node-pre-gyp,这远远领先于node-openaplr 存储库中的最后一次提交。

    fork node-openaplr 存储库并在 package.json 中的 node-pre-gyp 依赖项上指定提交哈希,然后将 node-openaplr 安装到项目使用

    yarn add https://github.com/bameyrick/node-openalpr
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-24
      • 2019-06-25
      • 1970-01-01
      • 2013-01-10
      • 1970-01-01
      • 2018-03-10
      • 2017-02-20
      • 1970-01-01
      相关资源
      最近更新 更多