Giter Site home page Giter Site logo

nprone-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nprone-cli's Issues

More descriptive error when mplayer is not installed

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.

[xcode Error - Still Builds] npm install -g npr-one | xcode-select: error: tool 'xcodebuild' requires Xcode | not CommandLineTools

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 rebuild

xcode-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_64

tyr:~ benc$ node -v
v6.3.0

tyr:~ benc$ npm -v
3.10.3

tyr:~ benc$ xcode-select -v
xcode-select version 2339.

Using '/Library/Developer/CommandLineTools' rather than XCode.app, installed using xcode-select --install

running after installing crashes

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)

not working on startup

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.

swagger init failed: undefined

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.

Not running at starttup

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.

auth.js does not handle refresh tokens

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.