Giter VIP home page Giter VIP logo

Comments (9)

SBoudrias avatar SBoudrias commented on August 16, 2024

Ugh, yeah.

That generator really isn't great. It needs to define patterns for options and arguments in it's constructor. And it need to be smarter.

from generator-node.

arthurvr avatar arthurvr commented on August 16, 2024

I'll look into this. Try running gulp babel and npm link again?

That generator really isn't great. It needs to define patterns for options and arguments in it's constructor. And it need to be smarter.

Yep. I totally agree.

from generator-node.

petersandor avatar petersandor commented on August 16, 2024

That creates the dist/cli.js, also npm link works. But when I try to run the module, this happens:

C:\Projects\testapp-node-cli
位 gulp babel
[23:14:11] Using gulpfile C:\Projects\testapp-node-cli\gulpfile.js
[23:14:11] Starting 'babel'...
[23:14:11] Finished 'babel' after 175 ms

C:\Projects\testapp-node-cli
位 npm link
C:\Users\<user>\AppData\Roaming\npm\testapp-node-cli -> C:\Users\<user>\AppData\Roaming\npm\node_modules\testapp-node-cli\dist\cli.js
C:\Users\<user>\AppData\Roaming\npm\node_modules\testapp-node-cli -> C:\Projects\testapp-node-cli

C:\Projects\testapp-node-cli
位 testapp-node-cli
C:\Projects\testapp-node-cli\lib\index.js:2
export default {};
 ^^^^^^
SyntaxError: Unexpected reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Projects\testapp-node-cli\dist\cli.js:15:10)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

from generator-node.

arthurvr avatar arthurvr commented on August 16, 2024

That creates the dist/cli.js, also npm link works.

Well, that's the expected behaviour. When using babel you of course have to compile your code first.

But when I try to run the module, this happens:

This is a bug not related to the CLI. The problem is that our main in the generated package.json points to lib/index.js, which is a problem when using babel as that's the source version not the compiled version.

from generator-node.

petersandor avatar petersandor commented on August 16, 2024

I see, thanks for looking into this. 馃憤

Also, I would like to mention that as a new user I was a bit confused by this issue since this wasn't happening when I ran yo node:cli (without --no-babel, doesn't it default to true?), it created only lib/cli.js and everything worked.

from generator-node.

SBoudrias avatar SBoudrias commented on August 16, 2024

@petersandor This is not an issue on your side. This generator output is broke. We'll fix it.

from generator-node.

SBoudrias avatar SBoudrias commented on August 16, 2024

@arthurvr You assigned yourself that ticket. I think it's working fine now, can you double check and close it if that's the case? Thanks :)

from generator-node.

arthurvr avatar arthurvr commented on August 16, 2024

Looks alright now. Nice work @SBoudrias :)

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

馃憤

from generator-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 馃搳馃搱馃帀

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google 鉂わ笍 Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.