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.

func new function produces error when global yo is installed

See original GitHub issue

Repro steps

Provide the steps required to reproduce the problem

  1. Install packages
npm install -g yo generator-azurefunctions azure-functions-cli
  1. Create new function app and function
mkdir foo
cd foo
func init
func new function foofunc

Expected behavior

The function foofunc should be created.

Actual behavior

module.js:442
    throw err;
    ^

Error: Cannot find module 'C:\Users\adrianha\AppData\Roaming\npm\node_modules\azure-functions-cli\node_modules\yo\lib\cl
i.js'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3


Tip: run `func run <functionName>` to run the function.

Known workarounds

Use yo azurefunctions instead of func new function

Related information

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
adrianhallcommented, Nov 1, 2016

@jthake This is a separate issue - probably related to your node version - Yeoman requires minimal version of node. What version of node do you have installed? (Tip: Upgrade to node 6.x LTS and try again).

0reactions
lindydonnacommented, Dec 21, 2016

Will be handled by fix for https://github.com/Azure/azure-webjobs-sdk-script/issues/856, closing this issue as we’re going to revisit the yeoman dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm - yo - yeoman-environment/generator error
I am new to yeoman and related stuff. Just followed guidelines to install yo and generator-code. Wasn't that enough?
Read more >
Custom functions quick start - Office Add-ins
To install these tools globally, run the following command via the command prompt. command line. Copy. npm install -g yo generator- ...
Read more >
Firebase error type. initializeApp(options: DefaultFi To get th
In project web folder create a new file firebase-messaging-sw. ... I went into functions and ran npm install --save firebase and the deploy...
Read more >
Universal Cyclopd̆ia and Atlas
( 1 ) x Replace by a new quantity , x ' , thus : x = x ' — } a ....
Read more >
American Lumberman
An interesting feature of the morning session was the roll call ... comprise the functions of a national association without jeopardizing its own...
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