question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI: Running new node.js function fails...

See original GitHub issue

Please provide a succinct description of the issue.

Repro steps

Provide the steps required to reproduce the problem.

I have a video of the behavior here: https://1drv.ms/v/s!Al5K6Hl-Z2ggovkBH9Xy6sM4TpBgCQ

  1. Create a new folder for your function app
  2. Run func init
  3. Run func new and select:
    • List templates by language
    • JavaScript
    • TimerTrigger-NodeJS
    • name the new function timerTriggerJs
  4. fun func run .\timerTriggerJs --cli-dev
  5. When prompted, type “yes” to enable the launching of the web server.
  6. A window flashes briefly with the error message Unable to parse option verb
  7. An exception is reported at the command line:
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:7071
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at WebJobs.Script.Cli.Verbs.RunVerb.<RunAsync>d__22.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()

Expected behavior

It’s never worked for me, but I assume it is supposed to launch a server that runs the function.

Actual behavior

Window flashes with Unable to parse option verb message then closes and the exception shown above is returned.

Known workarounds

none.

Related information

I have a video of the behavior here: https://1drv.ms/v/s!Al5K6Hl-Z2ggovkBH9Xy6sM4TpBgCQ

Using Node.js

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mikezkscommented, Nov 17, 2016

Please reopen - it still does not work for me.

Install of npm i -g azure-functions-cli@0.2.11-preview​​​ works, but func shows Azure Functions Cli (0.2.10.0)

func run func1 does not work: Error: unknown argument run, but func function run func1 works (-> maybe wrong documentation?), but causes the same errors as reported above.​​​

1reaction
ahmelsayedcommented, Nov 12, 2016

npm i -g azure-functions-cli@0.2.11-preview​​​

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running new node.js function fails... · Issue #9
Running new node.js function fails. ... with the error message Unable to parse option verb; An exception is reported at the command line:....
Read more >
Nodejs fails to show output on the cmd
I'm new to nodejs, All I'm trying to do is running a simple nodejs file on windows ... server.on('error', function(e) { console.log(e); })....
Read more >
Top 10 Most Common Node.js Developer Mistakes
The Top 10 Most Common Mistakes That Node.js Developers Make ; // Trying to fetch an user object from the database. Node.js is...
Read more >
Errors | Node.js v20.5.1 Documentation
Errors#. Applications running in Node.js will generally experience four categories of errors: Standard JavaScript errors such as <EvalError>, <SyntaxError>, ...
Read more >
AWS Lambda function errors in Node.js
This page describes how to view Lambda function invocation errors for the Node. js runtime using the Lambda console and the AWS CLI....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found