OmniSharp / generator-aspnet

yo generator for ASP.NET Core
877 stars 168 forks source link

Generate MVC Controller Failed #582

Closed cevarief closed 5 years ago

cevarief commented 8 years ago

Short issue description

Yeoman internal module error when generating mvc controller

Expected behavior

SomeController.cs file created in current web directory

Actual behavior

Throw Error: ENOENT: no such file or directory ~/.npm-global/lib/node_modules/yo/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/polyfills.js:18node_modules/graceful-fs/polyfills.js:18 chdir.call(process, d) ^

Steps to reproduce the behavior

bash yo aspnet:MvcController HomeController


OS version (Win/Mac/*Nix?)

OSX El Capitan 10.11.4

NodeJS version

node --version
v4.4.0

Yeoman version

yo --version
1.7.0

Generator version

NPM 3.*:

npm list -g generator-aspnet
generator-aspnet@0.0.93

NPM 2.*:

npm ls generator-aspnet -ls=0 --long
empty
cevarief commented 8 years ago

Upgraded node js to v5.10.0, it's still the same.

cevarief commented 8 years ago

I tried to create HomeController.cs manually and remove it. The issue is gone when rerun yo aspnet:MvcController HomeController

Is it folder permission issue ?

peterblazejewicz commented 8 years ago

I've found only this: https://github.com/yeoman/generator-generator/issues/81 Do you get similar problems with using other subgenerators? (:Class, :TagHelper, :WebApiController, etc.)

czioutas commented 8 years ago

I have the same issue. But i dont think that the problem linked is related, as that one is permission based, and on the directory I am working on, there are no issues like that.

arruw commented 8 years ago

Having similar problem:

matjazmav@ubuntu:~/Workbench/aspnet-demo$ sudo yo aspnet:MvcController HomeController
/usr/lib/node_modules/yo/node_modules/graceful-fs/polyfills.js:18
  chdir.call(process, d)
        ^

Error: ENOENT: no such file or directory, uv_chdir
    at Error (native)
    at process.chdir (/usr/lib/node_modules/yo/node_modules/graceful-fs/polyfills.js:18:9)
    at process.chdir (/usr/lib/node_modules/generator-aspnet/node_modules/graceful-fs/polyfills.js:18:9)
    at new NamedGenerator (/usr/lib/node_modules/generator-aspnet/MvcController/index.js:12:13)
    at Environment.instantiate (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:328:10)
    at Environment.create (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:305:15)
    at Environment.run (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:364:24)
    at /usr/lib/node_modules/yo/lib/cli.js:140:11
    at Array.forEach (native)
    at /usr/lib/node_modules/yo/lib/cli.js:139:9
peterblazejewicz commented 8 years ago

@matjazmav I think this is related to this one (logged for review/udpate): https://github.com/OmniSharp/generator-aspnet/issues/757

thanhtran-skywalk commented 8 years ago

The following steps is worked for me:

  1. create folder Controller in aspnet project.
  2. cd Controller
  3. yo aspnet:MvcController ContactController
sayedihashimi commented 5 years ago

We are shutting this repo down, it's been replaced with dotnet new.