Hi Revath,

Hmm, I'm not sure this is the cause of the problem. When you use "npm link"
this effectively installs the generator as global and that is how I tested
the procedure. I've just unlinked, installed globally and run it,
uninstalled, installed locally and run it and haven't got an error.

If you add to a Gruntfile.js something like:

        copy: {
            // Checking /usr/lib/node_modules -> npm appears to be global
so lets use that...
            testGlobalInstall: {
                files: [{
                    expand: true,
                    cwd:
require('path').dirname(require.resolve('npm/lib/install.js')),
                    dest: '.tmp/scripts/',
                    src: [ 'install.js' ]
                }]
            },
            // checking ./node_modules -> grunt is local so lets use that...
            testLocalInstall: {
                files: [{
                    expand: true,
                    cwd:
require('path').dirname(require.resolve('grunt/lib/grunt/config.js')),
                    dest: '.tmp/scripts/',
                    src: [ 'config.js' ]
                }]
            }
        }

and then run: grunt copy:testGlobalInstall copy:testLocalInstall does that
work?

What's the error you're seeing? Is this a node 0.8 problem? I'm on node
0.10.5.

Many thanks,

Andy



On 3 May 2013 21:06, Revath S Kumar <notifications@github.com> wrote:

> In app/templates/Gruntfile.js:
>
> > @@ -237,6 +241,14 @@ module.exports = function (grunt) {
> >              }
> >          },
> >          copy: {
> > +            defaultTemplate: {
> > +                files: [{
> > +                    expand: true,
> > +                    cwd: require('path').dirname(require.resolve('generator-backbone/app/templates/templates.js')),
>
> @zeripath <https://github.com/zeripath> I think this is breaking when we
> install generator as global.
> can you please check and verify.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/yeoman/generator-backbone/pull/30/files#r4080488>
> .
>



-- 
Andrew Thornton
art27@cantab.net