Comments (9)
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.
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.
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.
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.
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.
@petersandor This is not an issue on your side. This generator output is broke. We'll fix it.
from generator-node.
@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.
Looks alright now. Nice work @SBoudrias :)
from generator-node.
馃憤
from generator-node.
Related Issues (20)
- Release new version of generator-node HOT 10
- [FEAT] Git hooks HOT 1
- eslint still failing
- [FEAT] Use yarn by default HOT 3
- Remove `--ignore-path` option in ESLint npm script HOT 3
- [Bug] Freezes when using node 8.1.0 HOT 2
- jest test for node 4 failed with error HOT 3
- npm install failed due to nsp check HOT 1
- Allow using scoped package names HOT 3
- Usage behind proxy HOT 5
- cannot replace 'pretest' script. HOT 4
- The Node Security Platform service is shutting down 9/30/2018 HOT 1
- TypeError: Cannot read property '0' of undefined HOT 4
- question: husky config not in generated package.json but it is devDependencies HOT 1
- suggestion:provider option installer and skipInstallSilent
- using yarn HOT 2
- Getting error while running yo node
- --skip-install not working
- Update dependencies to latest versions
- `generator.run is not a function` when i use [email protected] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google 鉂わ笍 Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-node.