简体   繁体   中英

How to install npm openlpr in nodejs

I have been trying to install the npm node-openalpr package but i am facing this error.How can i overcome this probblem?

> 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

I heard there is an issue regarding node-pre-gyp versions as this openalpr package is 5 years older. how do I overcome this problem?

I noticed in the node-openaplr package.json the dependency for node-pre-gyp points to the node-pre-gyp repository, which means it will pull in the latest version of node-pre-gyp, which is way ahead of the last commit made in the node-openaplr repository.

Fork the node-openaplr repository and specified a commit hash on the node-pre-gyp dependency in the package.json, and then installed node-openaplr to project using

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM