Open natevw opened 8 years ago
c.f. https://blogs.windows.com/buildingapps/2015/05/12/bringing-node-js-to-windows-10-iot-core/ — perhaps MS has already provided UWP bindings in their Chakra version of node?
UPDATE: yup, https://www.npmjs.com/package/uwp
Visual studio 2015 has a very good plugin for nodejs development. It lets you put breakpoints even in nodejs code and single step through the logic. Obviously, no spi port. My hope was to use visual studio for the development and save the files onto a shared folder with the raspberry. Then run the raspberry to test the spi, and run on windows to test everything else. By visual studio throws a fit when I try to install the pi-spi module. Here is what I get:
pi-spi@1.0.1 install c:\users\john\Downloads\expresstut\expresstut\node_modules\pi-spi node-gyp rebuild c:\users\john\Downloads\expresstut\expresstut\node_modules\pi-spi>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:401:14) gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15) gyp ERR! System Windows_NT 10.0.10586 gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd c:\users\john\Downloads\expresstut\expresstut\node_modules\pi-spi gyp ERR! node -v v4.4.5 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "pi-spi" "--save" npm ERR! node v4.4.5 npm ERR! npm v2.15.5 npm ERR! code ELIFECYCLE npm ERR! pi-spi@1.0.1 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pi-spi@1.0.1 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the pi-spi package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs pi-spi npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls pi-spi npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! c:\users\john\Downloads\expresstut\expresstut\npm-debug.log
====npm command completed with exit code 1====
@johngrabner This looks like a generic npm configuration issue:
gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
See e.g. https://stackoverflow.com/questions/21365714/nodejs-error-installing-with-npm.
This issue here is to track actual Windows support, since there are Windows "IoT" apis available that could give us SPI support. I'll update the title here to clarify.
Right now this project just builds a stub version (that compiles, but throws a runtime error if actually used) on platforms like OS X and Windows i.e. anywhere where the Linux SPI module does not exist.
For Windows 10 though, say running on RasPi 2, there is a set of "IoT" interfaces, including SPI: https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.spi.aspx