Install MEAN.js 0.4.0 and run using Gulp

It’s time to take MEAN.js version 0.4.0 for a spin! We’ll go through the installation process using the new generator, and run the new app using gulp.
Please note that 0.4.0 is still under development.

1. Npm install meanjs/generator-meanjs#0.4-dev
2. Yo meanjs
3. Go through the generator prompts
4. Set up a mongo sandbox environment (http://youtu.be/oDvXkU8LRe4)
5. Update the package.json file to allow Gulp to run
6. Run Gulp to start the app
7. Open the app !

Check out www.bossable.com for more videos!

31 Comments

Let me know what you think

  • Shawn
    Reply

    Hi, I’m at my terminal on Mac 10.10.5 having the following trouble at the “yo” step:

    Shawns-iMac:dev root# yo
    /usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:90
    throw err0;
    ^
    Error: EACCES, permission denied ‘/var/root/.config’
    at Error (native)
    at Object.fs.mkdirSync (fs.js:747:18)
    at sync (/usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:77:24)
    at Object.create.all.get (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:31:13)
    at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:20:44)
    at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
    at Object. (/usr/local/lib/node_modules/yo/lib/cli.js:130:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    Shawns-iMac:dev root#

    • bossable

      hey there – you’re hitting an access control error.

      Do a quick google search for ‘Error: EACCES, permission denied ‘/var/root/.config’ and it should give you a few options.

    • bossable

      Pretty much all videos/posts created over the last 5 months have used 0.4. For an intro, have a look at the bossable home page (scroll down a bit to the 0.4 section)

  • Hun Yong Song
    Reply

    Hello. I’m trying to install version 0.4.0 and it doesn’t work. When I entered the command “npm install -g meanjs/generator-meanjs#0.4-dev”, and it said “zsh: no matches found: meanjs/generator-meanjs#0.4-dev”. I’ve tried alomost 10 times, but it is still same trouble. I was doing fine with old version of meanjs, but I don’t know why. Please help me to get it.

    My npm version is this :
    { npm: ‘2.10.1’,
    http_parser: ‘2.3’,
    modules: ’14’,
    node: ‘0.12.2’,
    openssl: ‘1.0.1m’,
    uv: ‘1.4.2-node1’,
    v8: ‘3.28.73’,
    zlib: ‘1.2.8’ }

    • bossable

      Hey there – I’m not entirely sure what the problem might be – if you want to, you could just download the zip for the 0.4 branch from here https://github.com/meanjs/mean/tree/0.4.0 and then unzip in the location that you want it installed, run npm install, and bower install. This will give you the full meanjs package.

      You could also do the same and grab the zip for the generator and put that in with your other global node modules.

    • bossable

      Just work through the errors, one at a time 🙂 Check your browsers console for errors on your blank screen.
      You may need to run ‘bower install’ to install the bower packages.

  • hightower10
    Reply

    I have only one Generator-meanjs and it’s .0.4 so the app gets built correctly, but when I add yo meanjs:crud-module DB I get the official MEANJS .0.4 generator instead of the crud menu.

  • hightower10
    Reply

    I may have installed a .0.3 crud module in mean 0.4. The applications was working until I added the crud model. How do you ensure the yo generation is updated to .0.4. I just assumed it was but may not be the case. Any direction your can provide would be great.

    • bossable

      The old and new versions of the generator have the same name (generator-meanjs). Do a quick search through your system to see if you have two folders called ‘generator-meanjs’, and make sure that the most recent one is within the same parent folder as where your global ‘yo’ package is installed. Check the created/updated date of the folder.

      Also check out this post if you need some background on global packages: http://www.bossable.com/1710/nodejs-package-path-for-windows/

    • bossable

      Hey Nida – the old and new versions of the generator have the same name (generator-meanjs) and if you’re not seeing the option to add socket-io, you may be using the older one. Do a quick search through your system to see if you have two folders called ‘generator-meanjs’, and make sure that the most recent one is within the same parent folder as where your global ‘yo’ package is installed.

  • Thoai Nguyen
    Reply

    I got an error when running “yo meanjs” : You don’t seem to have a generator with the name meanjs installed.
    Note: I ran step 1 “npm install meanjs/generator-meanjs#0.4-dev -g” and things seemed to work fine, though.
    Any suggestion to fix this problem?

  • Leto
    Reply

    If like me you get an error about node-sass when using yo meanjs, you have to downgrade your node version to get it to work, since node-sass is not working on node v0.11.x or above (i tried on v12, doesn’t work)
    i downgraded to 10.37 and it’s working now.

    • Oleg

      Hi,

      I am new to MEAN. What do you mean by “reinstalling node-sass with gulp-sass”? The link you posted did not provide this information.

      Thanks.

    • Oleg

      Hi Shristi,

      I am new to MEAN, so… I have node 0.12.1 installed and I am trying to use MEAN 0.4 and I got into node-sass module issue and cannot move forward. Your suggestion to install gulp-sass did not make it work. Do you know any workaround to get through the issue by any chance?

      Thanks.

    • bossable

      Hi Oleg – try the following:

      1. cd into your project directory: C:\your project directory\
      2. run ‘npm install gulp-sass’

      If you still have issues, then
      1. cd into the gulp-sass folder: C:\your project directory\node_modules\gulp-sass\
      2. run ‘npm install node-sass’

      If you still have issues, then
      1. You can try getting the packages directly by downloading the zip files from github, and extracting them into the locations above,
      2. cd into the relevant package, and run ‘npm install’ to install all dependencies for the package.

    • Oleg

      Thank you for such prompt reply.

      But it still did not work for me. So I already have nodejs 0.12.1 installed. And in empty directory run “yo” and enter all the info for my project. It fails and I run “npm install gulp-sass”. And then within the same directory I run “yo” again and enter all the info again. And it’s still fails.

      Any other ideas would be really appreciated.

      Thanks.

    • bossable

      Hi Oleg,

      You should only run yo once to create the project in an empty directory.
      All the ‘yo meanjs’ command is doing is setting up the project structure (the folders and the files), and then it runs the equivalent of ‘npm install’ and ‘bower install’.

      Try the following:
      1. Create a fresh project using ‘yo meanjs’, during the installation process if something fails, then you can install the failed package, such as ‘npm install gulp-sass’.
      2. Once you have installed the failed package, run ‘npm update’, to install any other packages which may not have been installed.
      3. Once you have done that, run ‘bower update’
      Then you should be all good. Let me know how it goes.

    • Oleg

      I tried that. It’s still the same issue. Because Installing node-sass version 2.1.1 does not change the dependency of meanjs on version 1.2.3. So it still fails.

      Thanks.

    • bossable

      Ah okay, I should have asked what errors you were seeing. If your errors are related to dependency versions, you can just update the relevant package.json file with the dependency version you are using.

  • koby
    Reply

    Hi Shristi,

    Thank you for the great video first. but I do have a question to ask though.

    I cannot debug the project in webstorm 9.0.3 through the gulp debug task. Do you have any idea?
    It seems that WebStorm uses a random debug port to listening the debug info, how “node.exe -debug” set in nodemon task is by default listening on port 5858. Since they are not listening on a same port, the breakpoint set in WebStorm are never hit.

    Do you have any solution? Thanks.

    • koby

      Hi, Shristi,
      I found a way to do the debugging with Gulp and nodemon in WebStorm 9.0.3.
      (1) create a gulp.js Run/Debug configuration, and specify task as debug (the task defined in gulpfile.js. it will start nodeman with –debug)
      (2) Run (not Debug) the configuration
      (3) create a Node.js Remote Debug configuration, and use the default settings (port 5858, this is the default node debug port)
      (4) Debug (Run is disabled) the remote debug configuration. It will listen on port 5858, which is the node debug port.
      (5) set breakpoints in your code, and start to debug.

      Note:
      (1) if you want to debug from the begining, you can change –debug to –debug-brk in nodeman task in the gulpfile.js file;
      (2) if you want to use another debug port, use –debug=9999 in gulpfile.js and also change the port in the remote debug configuration to match.

      Hope this will help for anyone who has the similar issue.

      Koby