Home

How to fix error while creating Tool extension from Windows Admin Center CLI

%3CLINGO-SUB%20id%3D%22lingo-sub-533105%22%20slang%3D%22en-US%22%3EHow%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-533105%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20related%20to%20developing%20extension%20for%20Windows%20Admin%20Center.%20There%20is%20SDK%20provided%20for%20the%20same%20by%20Microsoft%20to%20develop%20extensions.%20here%20is%20detail%20documentation%20which%20I%20was%20following%20%22%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fmanage%2Fwindows-admin-center%2Fextend%2Fdeveloping-extensions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fmanage%2Fwindows-admin-center%2Fextend%2Fdeveloping-extensions%3C%2FA%3E%22%3C%2FP%3E%3CP%3ECreate%20tool%20extension%3A%3C%2FP%3E%3CP%3EReferring%20to%20section%20%22Prepare%20your%20development%20environment%22%20I%20have%20installed%20prerequisites.%3C%2FP%3E%3CP%3EAfter%20that%20I%20tried%20to%20next%20step%20to%20create%20tool%20by%20using%20Windows%20Admin%20Center%20CLI.%20I%20executed%20following%20command%3C%2FP%3E%3CP%3E%3CEM%3Ewac%20create%20--company%20%22Contoso%20Inc%22%20--tool%20%22Manage%20Foo%20Works%22%3C%2FEM%3E%3C%2FP%3E%3CP%3EBut%20system%20gives%20following%20error%3C%2FP%3E%3CP%3E%3CSTRONG%3Econst%20%7B%20readdir%2C%20stat%20%7D%20%3D%20require('fs').promises%3B%20TypeError%3A%20Cannot%20destructure%20property%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CFONT%20color%3D%22%23242729%22%3Ereaddir%3C%2FFONT%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eof%20'undefined'%20or%20'null'.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EIs%20there%20something%20missing%20while%20creating%20development%20environment.%3C%2FP%3E%3CP%3E%3CSTRONG%3EEnvironment%20details%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EWindows%2010%20Professional%2C%20npm%406.9.0%2C%20node%40v9.11.1%2C%20angular%20cli%3A%206.1.5%2C%20typescript%202.9.2%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-564040%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-564040%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330472%22%20target%3D%22_blank%22%3E%40TusharBhagat%3C%2FA%3E%26nbsp%3BCan%20you%20run%20this%20in%20the%20same%20path%20you%20are%20trying%20to%20create%20an%20extension%3A%3C%2FP%3E%0A%3CPRE%3Enpm%20list%3C%2FPRE%3E%0A%3CP%3Eand%20let%20me%20know%20which%20version%20of%20the%20windows-admin-center-cli%20you%20have%20installed%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-567938%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-567938%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F341478%22%20target%3D%22_blank%22%3E%40alexanderboswell%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20little%20bit%20confused%20about%20version%20I%20can%20get%20for%20different%20CLI.%3C%2FP%3E%3CP%3EWhen%20I%20execute%20npm%20List%20in%20the%20same%20folder%20where%20I%20am%20going%20to%20create%20extension%20I%20am%20getting%20package%20version%20as%26nbsp%3B%3CSTRONG%3Ewindows-admin-center-cli%400.1.26%3C%2FSTRONG%3E%20or%20if%20latest%20installed%20then%26nbsp%3B%3CSTRONG%3Ewindows-admin-center-cli%400.1.29%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EBut%20I%20get%20different%20output%20when%20I%20am%20executing%20command%20%3CEM%3Enpm%20wac-cli%20-v%3C%2FEM%3E%20%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E6.9.0%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20answer%20to%20your%20question%2C%20I%20am%20getting%20version%200.1.26%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-569900%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-569900%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330472%22%20target%3D%22_blank%22%3E%40TusharBhagat%3C%2FA%3E%26nbsp%3BI%20believe%20this%20error%20might%20of%20been%20fixed%20in%20a%20recent%20version.%20Can%20you%20try%20installing%26nbsp%3B%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewindows-admin-center-cli%400.1.29%26nbsp%3B%3C%2FSTRONG%3Eand%20see%20if%20you%20get%20the%20same%20issue%3F%26nbsp%3B%3CEM%3E%26nbsp%3B%3C%2FEM%3EI%20am%20not%20sure%20what%26nbsp%3B%3CSTRONG%3Ewac-cli%26nbsp%3B%3C%2FSTRONG%3Eis%20referring%20to%20as%20we%20do%20not%20have%20versions%20that%20high.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-575602%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-575602%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F341478%22%20target%3D%22_blank%22%3E%40alexanderboswell%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20have%20installed%20latest%20windows%20admin%20center%20with%20version%200.1.29%20and%20tried%20same%20command%20as%3C%2FP%3E%3CP%3E%3CEM%3E%22wac%20create%20--company%20Microsoft%20--tool%20Foo%20--version%20insider%22%3C%2FEM%3E%3C%2FP%3E%3CP%3EBut%20still%20I%20am%20getting%20same%20error%20as%20shown%20in%20attached%20image%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655879%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655879%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330472%22%20target%3D%22_blank%22%3E%40TusharBhagat%3C%2FA%3E%26nbsp%3BI%20am%20still%20looking%20into%20this%20issue.%20I%20am%20having%20a%20difficult%20time%20trying%20to%20reproduce%20the%20issue.%20I%20will%20provide%20any%20update%20when%20it%20is%20available.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-659371%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-659371%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330472%22%20target%3D%22_blank%22%3E%40TusharBhagat%3C%2FA%3E%26nbsp%3Bcan%20you%20try%20doing%20these%20installs%20again%3F%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fmanage%2Fwindows-admin-center%2Fextend%2Fprepare-development-environment%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fmanage%2Fwindows-admin-center%2Fextend%2Fprepare-development-environment%3C%2FA%3E)%3C%2FP%3E%0A%3CPRE%3Enpm%20install%20-g%20npm%0A%0Anpm%20install%20-g%20%40angular%2Fcli%401.6.5%0A%0Anpm%20install%20-g%20gulp%0Anpm%20install%20-g%20typescript%0Anpm%20install%20-g%20tslint%0Anpm%20install%20-g%20windows-admin-center-cli%3C%2FPRE%3E%0A%3CP%3EI%20have%20followed%20our%20documentation%20found%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fmanage%2Fwindows-admin-center%2Fextend%2Fdeveloping-extensions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fmanage%2Fwindows-admin-center%2Fextend%2Fdeveloping-extensions%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EI%20set%20up%20a%20clean%20environment%20in%20Windows%20Sandbox%20and%20followed%20the%20documentation.%20If%20this%20does%20not%20provide%20any%20change%20please%20provide%20any%20more%20details%20you%20have%20as%20I%20still%20cant%20reproduce%20this%20issue%20(npm%20version%20and%20node%20versions)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-680290%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-680290%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F341478%22%20target%3D%22_blank%22%3E%40alexanderboswell%3C%2FA%3EThanks%20for%20your%20reply.%3C%2FP%3E%3CP%3EI%20have%20followed%20the%20process%20but%20unfortunately%20I%20am%20facing%20same%20problem.%20But%20I%20can%20proceed%20with%20the%20changes%20suggested%20in%20GIT%20PR%20raised%20by%20%40nitinpawar28%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fwindows-admin-center-extension-template%2Fpull%2F49%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoft%2Fwindows-admin-center-extension-template%2Fpull%2F49%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20will%20try%20to%20do%20it%20on%20clean%20machine%20and%20will%20let%20you%20know.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-718528%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20fix%20error%20while%20creating%20Tool%20extension%20from%20Windows%20Admin%20Center%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-718528%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330472%22%20target%3D%22_blank%22%3E%40TusharBhagat%3C%2FA%3E%26nbsp%3BDid%20the%20above%20fix%20work%20for%20you%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

This is related to developing extension for Windows Admin Center. There is SDK provided for the same by Microsoft to develop extensions. here is detail documentation which I was following "https://docs.microsoft.com/en-us/windows-server/manage/windows-admin-center/extend/developing-extens..."

Create tool extension:

Referring to section "Prepare your development environment" I have installed prerequisites.

After that I tried to next step to create tool by using Windows Admin Center CLI. I executed following command

wac create --company "Contoso Inc" --tool "Manage Foo Works"

But system gives following error

const { readdir, stat } = require('fs').promises; TypeError: Cannot destructure property readdir of 'undefined' or 'null'.

Is there something missing while creating development environment.

Environment details

Windows 10 Professional, npm@6.9.0, node@v9.11.1, angular cli: 6.1.5, typescript 2.9.2

8 Replies
Highlighted

@TusharBhagat Can you run this in the same path you are trying to create an extension:

npm list

and let me know which version of the windows-admin-center-cli you have installed? 

@alexanderboswell 

I am little bit confused about version I can get for different CLI.

When I execute npm List in the same folder where I am going to create extension I am getting package version as windows-admin-center-cli@0.1.26 or if latest installed then windows-admin-center-cli@0.1.29

But I get different output when I am executing command npm wac-cli -v  

6.9.0

 

But answer to your question, I am getting version 0.1.26

Highlighted

@TusharBhagat I believe this error might of been fixed in a recent version. Can you try installing  windows-admin-center-cli@0.1.29 and see if you get the same issue?  I am not sure what wac-cli is referring to as we do not have versions that high.

Highlighted

@alexanderboswell

I have installed latest windows admin center with version 0.1.29 and tried same command as

"wac create --company Microsoft --tool Foo --version insider"

But still I am getting same error as shown in attached image

Highlighted

@TusharBhagat I am still looking into this issue. I am having a difficult time trying to reproduce the issue. I will provide any update when it is available.

Highlighted

@TusharBhagat can you try doing these installs again? (https://docs.microsoft.com/en-us/windows-server/manage/windows-admin-center/extend/prepare-developme...)

npm install -g npm

npm install -g @angular/cli@1.6.5

npm install -g gulp
npm install -g typescript
npm install -g tslint
npm install -g windows-admin-center-cli

I have followed our documentation found here: https://docs.microsoft.com/en-us/windows-server/manage/windows-admin-center/extend/developing-extens...

I set up a clean environment in Windows Sandbox and followed the documentation. If this does not provide any change please provide any more details you have as I still cant reproduce this issue (npm version and node versions)

Highlighted

@alexanderboswellThanks for your reply.

I have followed the process but unfortunately I am facing same problem. But I can proceed with the changes suggested in GIT PR raised by @nitinpawar28

https://github.com/microsoft/windows-admin-center-extension-template/pull/49

I will try to do it on clean machine and will let you know.

 

Highlighted