"token does not exist"

1.8k Views Asked by At

Hello and good afternoon all!

I have a problem with ASK CLI in that when I attempt to utilize "ask clone " it returns this error in my console:

ask clone amzn1.ask.skill.900c47d3-532f-45b5-975b-1c995c6dbd88 The property "token" does not exist. /usr/local/lib/node_modules/ask-cli/node_modules/simple-oauth2/lib/client/access-token.js:21 if ('expires_at' in this.token) { ^

TypeError: Cannot use 'in' operator to search for 'expires_at' in undefined at new AccessToken (/usr/local/lib/node_modules/ask-cli/node_modules/simple-oauth2/lib/client/access-token.js:21:22) at Object.createAccessToken [as create] (/usr/local/lib/node_modules/ask-cli/node_modules/simple-oauth2/lib/client/access-token.js:38:12) at isTokenExpired (/usr/local/lib/node_modules/ask-cli/lib/utils/oauth-wrapper.js:97:35) at Object.tokenRefreshAndRead (/usr/local/lib/node_modules/ask-cli/lib/utils/oauth-wrapper.js:84:10) at Object.module.exports.requestWithUrl (/usr/local/lib/node_modules/ask-cli/lib/api/request-wrapper.js:45:18) at Object.module.exports.request (/usr/local/lib/node_modules/ask-cli/lib/api/request-wrapper.js:26:20) at Object.callGetSkillStatus (/usr/local/lib/node_modules/ask-cli/lib/api/api-wrapper.js:229:20) at Command.handle (/usr/local/lib/node_modules/ask-cli/lib/api/skill.js:213:20) at Command.listener (/usr/local/lib/node_modules/ask-cli/node_modules/commander/index.js:315:8) at Command.emit (events.js:182:13) at Command.parseArgs (/usr/local/lib/node_modules/ask-cli/node_modules/commander/index.js:654:12) at Command.parse (/usr/local/lib/node_modules/ask-cli/node_modules/commander/index.js:474:21) at Object. (/usr/local/lib/node_modules/ask-cli/bin/ask-api.js:25:6) at Module._compile (internal/modules/cjs/loader.js:707:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10) at Module.load (internal/modules/cjs/loader.js:605:32)

I have scoured the Earth for solutions and found one way to bypass this is to "downgrade" the oauth from '1.0.2' to '1.5.0' however this does not seem to work.

Any input/suggestions on this?

1

There are 1 best solutions below

0
On

I had this problem a while ago. I uninstalled the cli and followed this tutorial to setup ASK-CLI and it worked.

When the ASK-CLI is installed for the first time it needs configuration with our aws account and amazon account. Sometimes our accounts are not get configured properly and results in problems in cloning and deploying the skill. It happen because the authentication token of CLI does not match with our accounts.

Solution:

Try running ask init command again. And If this does not work

Uninstall the ASK-CLI and install again. And Run ask init