Idea

ssz avatar image
ssz suggested

ask-cli broken by simple-oauth2 dependency update

Latest update to https://github.com/lelylan/simple-oauth2 switches to Promises/Async breaking the callbacks used in /lib/init/lwa.js and elsewhere

Fixed, upgrade ask-cli to latest version via npm, ignore below.

Until fixed, the simple-oauth2 dependency can be reverted to version 1.5.0

Temp fix:

change version in /usr/local/lib/node_modules/ask-cli/package.json from '^1.0.2' to '1.5.0'

then from the terminal in the directory run

npm update

More detailed instructions for fix: https://forums.developer.amazon.com/comments/119007/view.html

ask cli
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

darianbjohnson avatar image
darianbjohnson commented

I upgraded my version of Node to 8.9.4, which fixes that oauth problem (though I'm still having problems with the code updating the config with the correct tokens) https://forums.developer.amazon.com/questions/117632/ask-cli-does-not-deploy-a-new-skill-and-does-not-l.html

3 comments
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I had the same issue as you described in that post.

  • ask clone did nothing, no list of skills
  • ask deploy would hang, switching quickly between "skill status checking" and "updating skill"

I believe tokens are generated for one hour and then refreshed as required, in your case was the last time you used the ask-cli (successfully) on Feb 18? I think the new version of ask-cli you are using is unable to create a new token and replace the one in your config in the .ask directory.

In any case downgrading the dependency fixed the two issues I was having above.

0 Likes 0 ·

That's exactly what's happening. Hoping this gets resolved soon.

0 Likes 0 ·

I put a temp fix in the main post above.

0 Likes 0 ·
martindsouza avatar image
martindsouza commented

I've tried to downgrade but no luck. To confirm how is going from 1.0.2 to 1.5.0 downgrading?

5 comments
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

'^1.0.2' allows for any version greater than 1.0.2 and less than 2.0.0, on a new install this would result in version 1.5.1

You can see the releases here: https://github.com/lelylan/simple-oauth2/releases.

Users who haven't installed or updated the ask-cli package within the last 3 days wouldn't have the version of simple-oauth2 causing problems (for me at least).

You can view what version of the dependency ask-cli is using on your machine by running

npm list -g --depth=1

and looking at simple-oauth2 under the ask-cli section.

0 Likes 0 ·

ahh can't believe I missed that one. Thanks for clarifying. Works perfectly!.

0 Likes 0 ·

Another way to do it without manually modifying package.json. Note: my global directory may be different for you so included some output to help show here I'm doing the updates.

bash-4.3$ echo $NPM_CONFIG_PREFIX
/home/node/.npm-global

bash-4.3$ pwd
/home/node/.npm-global/lib/node_modules/ask-cli

bash-4.3$ npm install simple-oauth2@1.5.0 --save-exact
npm WARN ask-cli@1.1.0 No repository field.
npm WARN ask-cli@1.1.0 license should be a valid SPDX license expression

+ simple-oauth2@1.5.0
updated 1 package in 2.337s
0 Likes 0 ·

For posterity here's a simple way to update using npm (so don't need to manually update package.json). Note: that your directory may be different. I've included some information about where my node_modules was installed. In my case it's /home/node/.npm-global/lib/node_modules/ask-cli.

bash-4.3$ pwd
/home/node/.npm-global/lib/node_modules/ask-cli

bash-4.3$ echo $NPM_CONFIG_PREFIX
/home/node/.npm-global

bash-4.3$ pwd
/home/node/.npm-global/lib/node_modules/ask-cli

bash-4.3$ npm install simple-oauth2@1.5.0 --save-exact
npm WARN ask-cli@1.1.0 No repository field.
npm WARN ask-cli@1.1.0 license should be a valid SPDX license expression

+ simple-oauth2@1.5.0
updated 1 package in 2.337s
0 Likes 0 ·
Show more comments

Write a Comment

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.