Skip to content
This repository was archived by the owner on Feb 17, 2019. It is now read-only.
This repository was archived by the owner on Feb 17, 2019. It is now read-only.

Experimental feature warning #12

Closed

Description

@billc3012

When running my N-API code I get this warning

(node:21984) Warning: N-API is an experimental feature and could change at any time.

This is a nuisance. Can we have an API call to disable the warning message if we dont want it ?

By the way, I like N-API

Activity

  1. mhdawson commented on Dec 1, 2017

    @mhdawson
    Member

    Can you use --no-warnings ? That should suppress the warning along with all others.

    I guess you were hoping to be able to disable it for users of your module ?

  2. billc3012 commented on Dec 1, 2017

    @billc3012
    Author
  3. webern commented on Jul 13, 2018

    @webern

    I would also like to suppress this warning. It served it's purpose, I understand that I am using an experimental feature, but I am tired of the clutter. Thanks.

  4. mhdawson commented on Jul 16, 2018

    @mhdawson
    Member

    @webern my guess is that you are using 8.x, right?

    In 6.x it is still doc experimental but there is no longer a warning
    In 10.x and higher -> stable no warning
    In 8.x -> just waiting for next semverMinor (see nodejs/node#21593). I've already backported the change to remove the warning, just waiting for the release :)

  5. webern commented on Jul 16, 2018

    @webern
  6. mhdawson commented on Jul 16, 2018

    @mhdawson
    Member

    Since 9.x is no longer supported we'd not be updating it there. I meant 8.x with 8.12 being the semVer minor release that we are waiting on.

  7. webern commented on Aug 12, 2018

    @webern

    Thank you for this info, I resolved the issue by updating my project to 10.7. This issue can be closed.

  8. mhdawson commented on Aug 22, 2018

    @mhdawson
    Member

    Closing

  9. jukefr commented on Nov 5, 2018

    @jukefr

    Is there any way to make this an environment variable of some sorts ?

    I am currently writing a unix executable along these lines

    #!/usr/bin/env node
    const fs = require('fs').promises
    // more logic...
    

    So passing the argument in this case is not an option.

    EDIT: nodejs/node#10842 feature was already requested and merged apparently

  10. ancms2600 commented on Dec 6, 2018

    @ancms2600

    In case it was not clear, if you are on the lts/carbon 8.x branch, you can stay on that major version just upgrade the minor version to something >= 8.12 to resolve this warning.

  11. BananaAcid commented on Feb 10, 2019

    @BananaAcid

    @jukefr another shebang line might help:

    #!/bin/sh
    ':' //; exec "$(command -v node)" "--experimental-modules" "--no-warnings" "$0" "$@"
    
    import fsOrig from 'fs';
    const fs = fsOrig.promises;
    
    (async () => {
      let files = await fs.readdir( process.cwd() );
      console.log( files );
    })().catch(console.error);
    

    I coded this here,to test this case.

    • $(command -v node) finds the executable's full path (do not use which), passes it to exec, since exec can use environment variables (shebang can not), and executes it with all params
    • env can only take ONE parameter, so this second line is needed.
    • $0 is the script (first param), $@ all the other manually passed ones from the command line
    • works with WSL ;)
  12. ackvf commented on Feb 14, 2019

    @ackvf

    I am on node 10.10 and I still get the ExperimentalWarning.

  13. mhdawson commented on Feb 16, 2019

    @mhdawson
    Member

    @ackvf can you open a new issue with the information on how to recreate? Please include node --version, platform and the command line you used along with what is necessary to recreate. There should be no warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions