func init failure
See original GitHub issuefunc init fails. It took some fiddling to get --cli-dev to work, since it doesn’t recognize an implicit working directory. Git wasn’t in my path, and I thought that might be the issue but it fails even when git is present in the path.
c:\GitHub\AzureFunctions>func init
Writing .gitignore
Writing host.json
Writing .secrets
Error: The system cannot find the file specified
You can run the same command passing --cli-dev and report an issue on https://github.com/azure/azure-webjobs-sdk-script/issues
c:\GitHub\AzureFunctions>func init --cli-dev
Unable to parse option Folder
Azure Functions CLI 0.1
Usage: func init [Options]
<folder> (Required)
--vsc Version Control Software. Git or Hg
--help Show this help
c:\GitHub\AzureFunctions>func init . --cli-dev
Writing .gitignore
Writing host.json
Writing .secrets
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at WebJobs.Script.Cli.Common.Executable.<RunAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at WebJobs.Script.Cli.Verbs.InitVerb.<RunAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at NCli.ConsoleApp.<RunAsync>d__5`1.MoveNext()
Repro steps
Provide the steps required to reproduce the problem
-
npm i -g azurefunctions
-
npm i -g generator-azurefunctions yo
-
func init
Expected behavior
func init
should succeed.
Actual behavior
Apparently an exe can’t be found but I don’t know which one.
Known workarounds
Unknown
Related information
npm 3.10.8 node 6.9.1 git 2.6.2.windows.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
func init is not recognized on the local machine
the command. func init --worker-runtime dotnet --force. is failing with the message. 'func' is misspelled or not recognized by the system.
Read more >Why am I getting an error in the GO init() method?
In Go foo:="bar" is a short assignment statement that can be used in a function in place of a var declaration.
Read more >Handle errors in init
I have an init func in a package. Inside the init function, I have a database initialization which returns error. How can I...
Read more >Enforce compiler error if init function isn't called? : r/rust
I would simply imagine an object that can only be obtained through that init function - even if that specific object doesn't contain...
Read more >Golang Mistakes: #2 Misusing Init() Functions - Rezwanul's Blog
In this above Go blog example, the init function cannot fail ( http.HandleFunc can throw panic only if the handler is nil ,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was what I did:
npm i -g azure-functions-cli mkdir functest cd functest func init
Writing .gitignore Writing host.json Writing appsettings.json System.ComponentModel.Win32Exception (0x80004005): The system cannot find the fi le specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn fo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at WebJobs.Script.Cli.Common.Executable.<RunAsync>d__6.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot ification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() at WebJobs.Script.Cli.Actions.LocalActions.InitAction.<RunAsync>d__5.MoveNext () --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot ification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at WebJobs.Script.Cli.ConsoleApp.<RunAsync>d__4
1.MoveNext()@paulbatum Yes, I think so. @s1monfarrow, please watch issue https://github.com/Azure/azure-webjobs-sdk-script/issues/1053 for the fix.