0

I have been using mean.js version 0.3 with no problems up untill now. Today I decided to checkout mean.js 0.4 so I ran

npm install -g generator-meanjs

to install the new version of the generator, and then ran

yo meanjs

and I went through the steps of the generator which finished successfully, and I was able to run the example site.

However, when I tried to use yo to create my own modules with the following command:

yo meanjs:vertical-module customer

It runs the application setup again:

You're using the official MEAN.JS generator.
? What mean.js version would you like to generate? (Use arrow keys)
  master 
❯ 0.4.0 
  0.4.1

I tried looking for a solution, and the only thing I found was this issue: https://github.com/meanjs/generator-meanjs/issues/79

That suggested the cause is multiple versions of the generator is installed, so I tried uninstalling with the following command and then re-installing by repeating steps I described above

npm unstall -g generator-meanjs

But I am still getting the same results

I would really appreciate any suggestions as to how resolve this. TIA!

Ronny vdb
  • 2,324
  • 5
  • 32
  • 74

4 Answers4

0

I had the same problem, finally figured it out. Maybe it will work for you too:

# remove meanjs generator from npm global
sudo npm remove generator-meanjs -g
sudo npm cache clean -g

# figure out where my npm global modules are
npm root -g
Result: /usr/local/lib/node_modules

# cd to the npm global directory
cd /usr/local/lib/node_modules

# get the latest Yo generator code from GitHub
sudo git clone https://github.com/meanjs/generator-meanjs

# switch to the 0.4-dev branch
cd generator-meanjs
sudo git checkout origin/0.4-dev

#install (run while in generator-meanjs dir)
sudo npm install

# test it
cd ~/ 
mkdir tmp
cd tmp
yo meanjs:vertical-module my_crud_module
0

try to install the following version of meanjs generator

npm install -g meanjs/generator-meanjs#0.4-dev

then use

yo meanjs:vertical-module customer

i think that will help.

  • This path no longer works. Earlier today, the team released 0.4.2 of the MeanJS Yeoman generator ... BUT, BUT, BUT ... that only builds the main MeanJS project. Now, we need to wait or help code all the 0.3 sub-modules generators. Especially the "vertical module generator"!!! – Allen Hurff Dec 05 '15 at 06:26
0

After hours of haunting errors I managed to find a way to generate crud module. As you guys know 0.4.x generators are still under development so there's a way to create another meanjs project folder with 0.3 version. You can downgrade to meanjs 0.3x without destroying the meanjs 0.4 project folder. All you have to do is to downgrade generator-meanjs to 0.1.12 version and downgrade yo to 1.3.3 or the versions till january 2015.

You can find the information about versions through:

sudo npm info -g yo

sudo npm info -g generator-meanjs

Umair Sarfraz
  • 177
  • 3
  • 5
  • 16
  • This can be done by running `npm install -g generator-meanjs@0.1.12` to install a specific version of the npm package – prcbass Feb 16 '16 at 19:21
-2

I came up with a hack to fix this issue:
1. Install the crud module when creating your meanjs application:
yo meanjs
this will install an articles crud module in the modules directory.
2. Replace all keywords article by name in all files.
3. Rename all filename with name instead of 'article' in the articles directory.

I have posted a video where I explain these steps in details:
https://www.youtube.com/watch?v=Nkpdp1ofux8

Amer
  • 1
  • 2