adafruit / nprone-cli Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
On a vanilla Sierra install, I ran npm install -g npr-one
and then got the following:
connecting to npr one...
events.js:160
throw er; // Unhandled 'error' event
^
The solution was to run brew install mplayer
. It'd be nice if the CLI could return with a more descriptive error when mplayer isn't installed.
tyr:~ benc$ npm install -g npr-one
/usr/local/bin/npr-one -> /usr/local/lib/node_modules/npr-one/cli[email protected] install /usr/local/lib/node_modules/npr-one/node_modules/dtrace-provider
node scripts/install.js[email protected] install /usr/local/lib/node_modules/npr-one/node_modules/i2c-bus
node-gyp rebuildxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
SOLINK_MODULE(target) Release/i2c.node
/usr/local/lib
└─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└── [email protected]tyr:~ benc$ uname -a
Darwin tyr.local 14.5.0 Darwin Kernel Version 14.5.0: Thu Apr 21 20:40:54 PDT 2016; root:xnu-2782.50.3~1/RELEASE_X86_64 x86_64tyr:~ benc$ node -v
v6.3.0tyr:~ benc$ npm -v
3.10.3tyr:~ benc$ xcode-select -v
xcode-select version 2339.
Using '/Library/Developer/CommandLineTools' rather than XCode.app, installed using xcode-select --install
I'm running node version 5.11.1 on Debian, after installing your package successfully and running it, I get the following error:
/usr/lib/node_modules/npr-one/node_modules/npr-api/lib/helpers.js:51
return (...args) => {
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/npr-one/node_modules/npr-api/lib/one.js:4:17)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
Current tutorial and hardware leads to a device that only plays if manually started over ssh.
PM2 reports the following error during installation:
"""
path.js:1144
cwd = process.cwd();
^
Error: ENOENT: no such file or directory, uv_cwd
at Error (native)
at Object.resolve (path.js:1144:25)
at startup (node.js:116:32)
at node.js:456:3
"""
Manually starting app via ssh section works, but pm2 simply keeps booting the app with 1-4 seconds of uptime before failure.
I was so excited when I found this CLI tool!
Sadly doesn't seeem to be working. There are errors in installation (though it succeeds) and runtime gets stuck at an error.
npm install -g npr-one
npm WARN deprecated [email protected]: No longer maintained, please upgrade to swagger-client@3.
npm WARN deprecated [email protected]: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header). This notice will go away with v5.0.2+ once it is released.
/usr/local/bin/npr-one -> /usr/local/lib/node_modules/npr-one/cli
> [email protected] install /usr/local/lib/node_modules/npr-one/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
sys.exit(gyp.script_main())
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
return main(sys.argv[1:])
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
return gyp_main(args)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2215, in GenerateOutput
part_of_all=qualified_target in needed_targets)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 794, in Write
extra_mac_bundle_resources, part_of_all)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 900, in WriteActions
env = self.GetSortedXcodeEnv()
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1885, in GetSortedXcodeEnv
additional_settings)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1616, in GetSortedXcodeEnv
additional_settings)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1527, in _GetXcodeEnv
if XcodeVersion() >= '0500' and not env.get('SDKROOT'):
TypeError: '>=' not supported between instances of 'tuple' and 'str'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:305:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/13.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/npr-one/node_modules/dtrace-provider
gyp ERR! node -v v13.5.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
> [email protected] install /usr/local/lib/node_modules/npr-one/node_modules/i2c-bus
> node-gyp rebuild
SOLINK_MODULE(target) Release/i2c.node
+ [email protected]
added 108 packages from 120 contributors in 5.361s
npr-one
██████████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████████
███████▄▄▄▄▄███▄▄████████████████▄▄▄▄▄███▄▄█████████████████▄▄▄▄▄▄████████████
███████████▄▄▄▄███▄██████████████████▄▄▄████▄████████████████████▄▄▄▄█████████
█████████████████████████████████████████▄████████████████████████████████████
███████████████████████████████████████████████████████████████▄██████████████
█████████████████████████████████████████▄████████████████████████████████████
████████████████████████████████████▄▄▄▄████▄█████████████████████████████████
███████▄▄▄██████▄▄▄█████████████████▄███▄▄▄█████████████████▄▄▄▄██████████████
██████████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████████
█████████████████████████████████▄▄▄██████████████████████████████████████████
connecting to npr one...
swagger init failed undefined
gets stuck here indefinitely.
Everything's working great when manually run with $ npr-one
but after using $ pm2 start npr-one && pm2 save
the errors shown by $ pm2 logs npr-one
lead to:
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
^
SyntaxError: Unexpected token [
Not sure why the bracket is acceptable when I run it but a syntax error through pm2.
The NPR-One API specifies an expiration value for device tokens. Auth.js stores the value once after the device is authorized the first time and never updates the value or checks it again. After the token expires, you'll get 401 errors indicating Unauthorized Access.
The workaround is to delete the npr-one file with the token and re-authorize the device.
Auth.js needs to check every time and handle the response per: https://dev.npr.org/guide/services/authorization/#refresh_token
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.