# How to install OpenPlc?

**URL:** <https://discourse.nodered.org/t/how-to-install-openplc/9570>\
**Category:** General\
**Created:** [29 March 2019 09:59 UTC](https://discourse.nodered.org/t/how-to-install-openplc/9570 "2019-03-29T09:59:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [29 March 2019 09:59 UTC](https://discourse.nodered.org/t/how-to-install-openplc/9570/1 "2019-03-29T09:59:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 March 2019 10:13 UTC](https://discourse.nodered.org/t/how-to-install-openplc/9570/2 "2019-03-29T10:13:37Z")

</div>

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...

---

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [29 March 2019 10:20 UTC](https://discourse.nodered.org/t/how-to-install-openplc/9570/3 "2019-03-29T10:20:02Z")

</div>

```auto

> 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

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 March 2019 10:21 UTC](https://discourse.nodered.org/t/how-to-install-openplc/9570/4 "2019-03-29T10:21:59Z")

</div>

That log is fairly clear in highlighting the error:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 March 2019 10:31 UTC](https://discourse.nodered.org/t/how-to-install-openplc/9570/5 "2019-03-29T10:31:36Z")

</div>

Have you installed Windows build tools?

From an admin CMD prompt...

> **[windows-build-tools](https://www.npmjs.com/package/windows-build-tools)**
>
> Install C++ Build Tools for Windows using npm

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.
