How to install OpenPlc?

#1

i have windows10 system and i want to install openPlc module. I use this command : npm install node-red-contrib-openplc and i get error ?
Can any one explain an give me solution to get this module installed ?
And thank you.

0 Likes

#2

If you are looking for help, posting the actual error would be useful. Along with details of what version of Node-RED and nodejs you are using...

1 Like

#3

> serialport@4.0.7 install C:\Users\hadhemi\node_modules\serialport
> node-pre-gyp install --fallback-to-build

node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
node-pre-gyp verb cli   'C:\\Users\\hadhemi\\node_modules\\serialport\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp',
node-pre-gyp verb cli   'install',
node-pre-gyp verb cli   '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp@0.6.32
node-pre-gyp info using node@10.15.1 | win32 | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "C:\Users\hadhemi\node_modules\serialport\build\Release\serialport.node" (not found)
node-pre-gyp http GET https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-win32-x64.tar.gz
node-pre-gyp http 404 https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.7 and node@10.15.1 (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-win32-x64.tar.gz
node-pre-gyp verb command build [ 'rebuild' ]
node-pre-gyp ERR! Tried to download(undefined): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.7 and node@10.15.1 (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
node-pre-gyp verb command build [ 'rebuild' ]
gyp gypERR! configure error
ERR! configure errorgyp
 ERR! stackgyp Error: Can't find Python executable "python", you can set the PYTHON env variable.
 gypERR!  ERR!stack  Error: Can't find Python executable "python", you can set the PYTHON env variable.
stackgyp     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
 gypERR!  ERR!stack      at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
stackgyp     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
 gypERR!  ERR! stackstack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gypgyp  ERR!ERR!  stackstack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! gypstack      at FSReqWrap.oncomplete (fs.js:154:21)
ERR! Systemgyp Windows_NT 10.0.17134
 ERR! gyp SystemERR!  Windows_NT 10.0.17134
command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\hadhemi\\node_modules\\serialport\\build\\Release\\serialport.node" "--module_name=serialport" "--module_path=C:\\Users\\hadhemi\\node_modules\\serialport\\build\\Release"
gypgyp  ERR!ERR!  cwdcommand C:\Users\hadhemi\node_modules\serialport
 "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\hadhemi\\node_modules\\serialport\\build\\Release\\serialport.node" "--module_name=serialport" "--module_path=C:\\Users\\hadhemi\\node_modules\\serialport\\build\\Release"
gypgyp  ERR!ERR!  cwdnode -v C:\Users\hadhemi\node_modules\serialport
 v10.15.1
gypgyp  ERR!ERR!  node -v v10.15.1
node-gyp -v v3.8.0
gypgyp  ERR!ERR!  node-gyp -vnot ok
 v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\hadhemi\node_modules\serialport\build\Release\serialport.node --module_name=serialport --module_path=C:\Users\hadhemi\node_modules\serialport\build\Release' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\hadhemi\node_modules\serialport\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\hadhemi\\node_modules\\serialport\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\hadhemi\node_modules\serialport
node-pre-gyp ERR! node -v v10.15.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\hadhemi\node_modules\serialport\build\Release\serialport.node --module_name=serialport --module_path=C:\Users\hadhemi\node_modules\serialport\build\Release' (1)
npm WARN rollback Rolling back tar-pack@3.3.0 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\hadhemi\node_modules\serialport\node_modules\node-pre-gyp\node_modules'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\hadhemi\package.json'
npm WARN hadhemi No description
npm WARN hadhemi No repository field.
npm WARN hadhemi No README data
npm WARN hadhemi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serialport@4.0.7 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@4.0.7 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\hadhemi\AppData\Roaming\npm-cache\_logs\2019-03-29T10_00_25_384Z-debug.log

nodejs version : v10.15.1
node-red version V0.19.5

0 Likes

#4

That log is fairly clear in highlighting the error:

ERR! stackgyp Error: Can't find Python executable "python", you can set the PYTHON env variable.

I'm not sure what else we can add to that.

0 Likes

#5

Have you installed Windows build tools?

From an admin CMD prompt...

Note it takes quite a while - you might think it's stalled.

After finishing, close command prompt and open a new one (so that path is set) then reinstall your desired node.

0 Likes