question

HidetakaOkamoto avatar image
HidetakaOkamoto asked

ask-cli shows `ExperimentalWarning: The fs.promises API is experimental`

Expected Behavior

All command should not show any warning.

<code>$ ask util

  Usage: ask-util 

  $ ask util [command]

  Util functions to manage the life cycle of Alexa Skills.

  Options:

    -h, --help                     output usage information

  Commands:

    generate-lwa-tokens [options]  generates LWA tokens from 3p clientId and clientCredentials

Current Behavior

ask-cli shows ExperimentalWarning at first line.

<code>$ ask util
(node:35788) ExperimentalWarning: The fs.promises API is experimental

  Usage: ask-util 

  $ ask util [command]

  Util functions to manage the life cycle of Alexa Skills.

  Options:

    -h, --help                     output usage information

  Commands:

    generate-lwa-tokens [options]  generates LWA tokens from 3p clientId and clientCredentials

Possible Solution

I think we should update fs-extra package to 6.0.1 or later.
jprichardson/node-fs-extra#578 (comment)

I've fixed issue by following actions.

<code>$ cd /usr/local/lib/node_modules/ask-cli
$ npm i -S fs-extra@6.0.1
$ ask util

  Usage: ask-util 

  $ ask util [command]

  Util functions to manage the life cycle of Alexa Skills.

  Options:

    -h, --help                     output usage information

  Commands:

    generate-lwa-tokens [options]  generates LWA tokens from 3p clientId and clientCredentials

Steps to Reproduce (for bugs)

<code>$ npm i -g ask-cli
$ ask util
(node:35788) ExperimentalWarning: The fs.promises API is experimental

  Usage: ask-util 

  $ ask util [command]

  Util functions to manage the life cycle of Alexa Skills.

  Options:

    -h, --help                     output usage information

  Commands:

    generate-lwa-tokens [options]  generates LWA tokens from 3p clientId and clientCredentials

Context

I wanna to run some CI tests, but for now, assertion does not work well.
Because the warning shows at first line.

test code

<code>const assert = require('power-assert')
const { spawn } = require('child_process')

describe('test by ask-cli', () => {
  it('exit code should be zero', (done) => {
    var cli = spawn('ask', [
      'api', 'get-model', '-s', 'amzn1.ask.skill.d7d6176c-ab76-4e4c-b5ee-81366c4cd223'
    ])

    cli.stdout.on('data', function (data) {
      assert.deepEqual(data.toString(), {})
      done()
    })
    cli.stderr.on('data', function (err) {
      assert.deepEqual(err.toString(), {})
      done()
    })

    cli.stdin.write('testing')
  })
})

test result

<code>  1) test by ask-cli
       exit code should be zero:
     Uncaught AssertionError [ERR_ASSERTION]: '(node:35815) ExperimentalWarning: The fs.promises API is experimental\n' deepEqual {}

Your Environment

<code>$ ask -v
1.4.0

Node.js and NPM Info

  • Node.js version used for development:
  • NPM version used for development:
<code>$ node -v
v10.1.0

$ npm -v
5.6.0

Kindly regards.

ask cli
10 |5000

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

1 Answer

Amazon_Bernardo Bezerra avatar image
Amazon_Bernardo Bezerra answered

Hello and thank you for posting in our forums.

I tried to reproduce the issue you mentioned, but wasn't able to:

[~]$ ask util

Usage: ask-util

$ ask util [command]

Util functions to manage the life cycle of Alexa Skills.

Options:

-h, --help output usage information

Commands:

generate-lwa-tokens [options] generates LWA tokens from 3p clientId and clientCredentials

Here is the environment where it was tested:

[~]$ ask -v
1.4.0
[~]$ node -v
v10.5.0
[~]$ npm -v
6.1.0

Regards,
Barry

10 |5000

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