generator-angular module is not creating a new project

后端 未结 2 1129
执笔经年
执笔经年 2021-01-12 11:25

I am new to yeoman set of tools. I run following commands in Ubuntu 12

$ npm install -g yo
$ npm install -g generator-webapp
$ yo webapp           


        
相关标签:
2条回答
  • 2021-01-12 11:40

    In my case,

    ISSUE: 'yo doctor' can find no errors on Windows 10. Updating yeoman didn't fix. FIX: May be a permission problem. I opened command prompt as Admin , run yo xxxx, it worked.

    0 讨论(0)
  • 2021-01-12 11:57

    NODE_PATH is probably not configured properly. In which case, just add the NPM prefix to the NODE_PATH. If you run yo doctor, the output is likely to be:

    [Yeoman Doctor] Uh oh, I found potential errors on your machine
    ---------------
    
    [Error] NPM root value is not in your NODE_PATH
      [info]
        NODE_PATH = /usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
        NPM root  = /home/eliranm/npm/lib/node_modules
    
      [Fix] Append the NPM root value to your NODE_PATH variable
        Add this line to your .bashrc
          export NODE_PATH=$NODE_PATH:/home/eliranm/npm/lib/node_modules
        Or run this command
          echo "export NODE_PATH=$NODE_PATH:/home/eliranm/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
    

    So, in order to solve this, just follow the doctor's orders. If you prefer to change the .profile configuration rather the bash's, just execute this:

    echo "export NODE_PATH=$NODE_PATH:/home/eliranm/npm/lib/node_modules" >> ~/.profile && source ~/.profile
    
    0 讨论(0)
提交回复
热议问题