Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Problem getting node.js to control servo

Npm install pololu-maestro has multiple errors, any ideas?
I have tried other packages and nothing is working for me, i am on windows 10 using 6 servo maestro.
Also interested in using on pi.

PS F:\A_Websites\Phidgettest> npm install pololu-maestro

> serialport@1.7.3 install F:\A_Websites\Phidgettest\node_modules\pololu-maestro\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 [
node-pre-gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
node-pre-gyp verb cli   'F:\\A_Websites\\Phidgettest\\node_modules\\pololu-maestro\\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 verb cli ]
node-pre-gyp info using node-pre-gyp@0.6.7
node-pre-gyp info using node@14.17.0 | win32 | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "F:\A_Websites\Phidgettest\node_modules\pololu-maestro\node_modules\serialport\build\serialport\v1.7.3\Release\node-v83-win32-x64\serialport.node" (not found)
node-pre-gyp http GET https://node-serialport.s3.amazonaws.com/serialport/v1.7.3/Release/node-v83-win32-x64.tar.gz
node-pre-gyp ERR! UNCAUGHT EXCEPTION 
node-pre-gyp ERR! stack ReferenceError: primordials is not defined
node-pre-gyp ERR! stack     at evalmachine.<anonymous>:45:5
node-pre-gyp ERR! stack     at Object.<anonymous> (F:\A_Websites\Phidgettest\node_modules\pololu-maestro\node_modules\serialport\node_modules\node-pre-gyp\node_modules\tar\node_modules\fstream\node_modules\graceful-fs\fs.js:11:1)
node-pre-gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:1068:30)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)        
node-pre-gyp ERR! stack     at Module.load (internal/modules/cjs/loader.js:933:32)
node-pre-gyp ERR! stack     at Function.Module._load (internal/modules/cjs/loader.js:774:14)
node-pre-gyp ERR! stack     at Module.require (internal/modules/cjs/loader.js:957:19)
node-pre-gyp ERR! stack     at require (internal/modules/cjs/helpers.js:88:18)
node-pre-gyp ERR! stack     at Object.<anonymous> (F:\A_Websites\Phidgettest\node_modules\pololu-maestro\node_modules\serialport\node_modules\node-pre-gyp\node_modules\tar\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:3:27)
node-pre-gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:1068:30)
node-pre-gyp ERR! System Windows_NT 10.0.19042
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "F:\\A_Websites\\Phidgettest\\node_modules\\pololu-maestro\\node_modules\\serialport\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd F:\A_Websites\Phidgettest\node_modules\pololu-maestro\node_modules\serialport
node-pre-gyp ERR! node -v v14.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.7
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 phidgettest@1.0.0 No description
npm WARN phidgettest@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! serialport@1.7.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the serialport@1.7.3 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\bruce\AppData\Roaming\npm-cache\_logs\2021-07-20T21_33_55_620Z-debug.log
PS F:\A_Websites\Phidgettest>

Hello.

It sounds like you might be trying to install the node-pololumaestro project discussed in this blog post.

I did a quick search for ReferenceError: primordials is not defined and found this stackoverflow post which might be related to the problem you’re getting. Please try some of the suggestions there and let us know the results.

- Amanda