29

I am new to node and npm and trying to understand AutoRest.

When I type

autorest --list-available

into powershell ISE I get

AutoRest code generation utility [version: 2.0.4262; node: v10.1.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
autorest : (node:12580) ExperimentalWarning: The fs.promises API is experimental
At line:1 char:1
+ autorest --list-available
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ((node:12580) Ex...is experimental:String) [], RemoteExc 
   eption
    + FullyQualifiedErrorId : NativeCommandError

 Extension Name                 Version       

 @microsoft.azure/autorest-core 2.0.4278       
 @microsoft.azure/autorest-core 2.0.4277       
 @microsoft.azure/autorest-core 2.0.4276       
 @microsoft.azure/autorest-core 2.0.4275       
 @microsoft.azure/autorest-core 2.0.4274       
 @microsoft.azure/autorest-core 2.0.4272       
 @microsoft.azure/autorest-core 2.0.4271       
 @microsoft.azure/autorest-core 2.0.4269       
 @microsoft.azure/autorest-core 2.0.4263       
 @microsoft.azure/autorest-core 2.0.4262       
Failure:
TypeError: volume[member].bind is not a function
TypeError: volume[member].bind is not a function
    at patchFilesystem 
(C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:277:43)
    at C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:281:18
    at Object.global.staticloader.undo 
(C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:163:7)
    at process.exit.n [as exit] 
(C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:170:27)
    at main (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\app.js:153:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12580) UnhandledPromiseRejectionWarning: Error: EBADF: bad file descriptor, close
    at Object.fs.closeSync (fs.js:529:3)
    at StaticVolumeFile.shutdown 
(C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:352:10)
    at StaticFilesystem.shutdown 
(C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:406:17)
    at process.exit.n [as exit] 
(C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:169:11)
    at main (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\app.js:239:17)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12580) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated 
either by throwing inside of an async function without a catch block, or by rejecting a promise 
which was not handled with .catch(). (rejection id: 1)
(node:12580) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the 
future, promise rejections that are not handled will terminate the Node.js process with a non-zero 

what is happening? exit code.

Kirsten
  • 15,730
  • 41
  • 179
  • 318

7 Answers7

29

Updating to the latest node version (v12.6+) removes the warning.

XCS
  • 27,244
  • 26
  • 101
  • 151
21

Yes, you can safely ignore this warning. If you want to suppress it (and all warnings), run your script with node --no-warnings instead of node.

In your example:

node --no-warnings `which autorest`
Ore4444
  • 9,119
  • 2
  • 23
  • 29
15

I was at node@^10.15.1 which is an older version so I update it to 12.16.1 or 12.16.2 and it got fixed.

Umar Asghar
  • 3,808
  • 1
  • 36
  • 32
9

The module autorest uses new fs syntax, that instead of callbacks uses Promises. This is however not yet stable and therefore is the warning. Nothing really to worry about, unless you want to use it in production. But even then, as long as you update autorest with node together no problems should occur.

As for the error, it may be something in your configs. Try to make minimal error sample and post an issue to autorest git.

Akxe
  • 9,694
  • 3
  • 36
  • 71
  • As an added note, since (s?)he is launching it from `powershell`, use `$ErrorActionPreference = 'SilentlyContinue'` to suppress the error. `powershell` has both terminating and non-terminating errors. Alternatively, `2>$null` at the end of the command. – Maximilian Burszley May 21 '18 at 14:33
8

I Was at node@10.16.1 and I update it to 12.18.2and it got fixed!

Consule
  • 1,059
  • 12
  • 12
4

It might have because you have updated the npm version but not the node version. I updated the npm version from 6.3.0 to 7.16.0 [latest at this time], but was still using 11.3.0 for the node. To fix this version, I updated node to the latest LTS, i.e. 14.17.0 [LTS at this time].

nvm install 14.17.0 // Check for the LTS
nvm use 14.17.0
nvm alias default 14.17.0
Parth Mansata
  • 145
  • 1
  • 7
  • This worked great for me. I substituted with 14.18.1 since that was the latest when I found my way to this answer. – benhorgen Nov 13 '21 at 06:08
2

In Angular 10 that's just a warning when serving your code, which you can ignore as of today.

Daniel Danielecki
  • 8,508
  • 6
  • 68
  • 94