Cognizant-CDE-Australia / generator-confit

Build-tool generator for current and future web.
https://odecee.github.io/generator-confit
Other
29 stars 3 forks source link

AssertionError: Trying to copy from a source that does not exist: ..../npm/node_modules/generator-confit/buildTool/webpack/sampleApp/templates/ng1/ES6/demoModule/templates #26

Closed tiddle closed 8 years ago

tiddle commented 8 years ago

Similar to issue #20

The "missing" folder exists and contains page1.html and page2.html

Confit App Generator
? Choose a build-profile for your project Webpack - Webpack-based build profile (23 Dec 2015)
? Supported browsers (required) Latest Versions (major browsers)
Writing "app" using Webpack
Project Path Generator
? Use default/existing paths? Yes
Build CSS Generator
? CSS source format sass
Build JS Generator
? Source code language ES6
? Target output language ES5
? JavaScript Framework (optional) AngularJS 1.x
? Vendor scripts OR module-names to include (edit in confit.json):
Build HTML Generator
? HTML source file extension? .html
Entry Point Generator
? Entry-points for the application (edit in confit.json):
Dev Server Generator
? Server port 3000
? Server hostname localhost
? Server protocol https
Production Server Generator
? Server port 3000
? Server hostname localhost
? Server protocol https
Verify Generator
? JavaScript coding standard none
Sample App Generator
? Create a sample app? Yes
Writing Webpack buildAssets options
Writing Webpack buildCSS options
Writing Webpack buildJS options
Writing Webpack buildHTML options
Writing Webpack build options
Writing Webpack serverDev options
Writing Grunt serverProd options
Writing Webpack unit-test options
Writing Protractor browser-test options
Writing Grunt verify options
Writing Webpack sampleApp options

events.js:141
      throw er; // Unhandled 'error' event
      ^
AssertionError: Trying to copy from a source that does not exist: C:/Users/Carlo/AppData/Roaming/npm/node_modules/generator-confit/buildTool/webpack/sampleApp/templates/ng1/ES6/demoModule/templates
    at EditionInterface.exports._copySingle (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:45:3)
    at EditionInterface.<anonymous> (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:38:10)
    at Array.forEach (native)
    at EditionInterface.exports.copy (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:35:9)
    at EditionInterface.module.exports [as copyTpl] (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:12:8)
    at write (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\buildTool\webpack\sampleApp\sampleApp.js:75:13)
    at module.exports.confitGen.create.writing (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\generators\sampleApp\index.js:99:26)
    at Object.<anonymous> (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\yeoman-generator\lib\base.js:436:25)
    at C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\run-async\index.js:24:25
    at C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\yeoman-generator\lib\base.js:446:8
    at processImmediate [as _immediateCallback] (timers.js:374:17)
uglow commented 8 years ago

From looking at the code, this seems to be a Windows-specific issue. The solution is to wrap every file-copying-path in either this.templatePath(...) or this.destinationPath(...), which will produce OS-specific path formats

uglow commented 8 years ago

@tiddle - please confirm that this fixes your issue.

tiddle commented 8 years ago

I just tried it with version 1.3.4 still no go.

I deleted and reinstalled Confit.

Confit App Generator
? Choose a build-profile for your project Webpack - Webpack-based build profile (23 Dec 2015)
? Supported browsers (required) Latest Versions (major browsers)
Writing "app" using Webpack
Project Path Generator
? Use default/existing paths? Yes
Build CSS Generator
? CSS source format stylus
Build JS Generator
? Source code language ES6
? Target output language ES5
? JavaScript Framework (optional) AngularJS 1.x
? Vendor scripts OR module-names to include (edit in confit.json):
Build HTML Generator
? HTML source file extension? .html
Entry Point Generator
? Entry-points for the application (edit in confit.json):
Dev Server Generator
? Server port 3000
? Server hostname localhost
? Server protocol https
Production Server Generator
? Server port 3000
? Server hostname localhost
? Server protocol https
Verify Generator
? JavaScript coding standard none
Sample App Generator
? Create a sample app? Yes
Writing Webpack buildAssets options
Writing Webpack buildCSS options
Writing Webpack buildJS options
Writing Webpack buildHTML options
Writing Webpack build options
Writing Webpack serverDev options
Writing Grunt serverProd options
Writing Webpack unit-test options
Writing Protractor browser-test options
Writing Grunt verify options
Writing Webpack sampleApp options
AssertionError: Trying to copy from a source that does not exist: C:/Users/Carlo/AppData/Roaming/npm/node_modules/generator-confit/buildTool/webpack/sampleApp/templates/ng1/ES6/demoModule/templates
    at EditionInterface.exports._copySingle (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:45:3)
    at EditionInterface.<anonymous> (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:38:10)
    at Array.forEach (native)
    at EditionInterface.exports.copy (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:35:9)
    at EditionInterface.module.exports [as copyTpl] (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:12:8)
    at write (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\buildTool\webpack\sampleApp\sampleApp.js:75:13)
    at module.exports.confitGen.create.writing (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\generators\sampleApp\index.js:110:26)
    at Object.<anonymous> (C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\yeoman-generator\lib\base.js:436:25)
    at C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\run-async\index.js:26:25
    at C:\Users\Carlo\AppData\Roaming\npm\node_modules\generator-confit\node_modules\run-async\index.js:25:19
uglow commented 8 years ago

@tiddle - sorry about this. I haven't installed a Windows VM to test this myself. The only thing special about the code at this line is it's using a wildcard to try to copy just the files (not the sub-directories) in the templates directory.

The library being used by copyTpl() is https://github.com/SBoudrias/mem-fs-editor, which supports globbing patterns. I'm going to try using .../*.* instead of .../* to see if that makes a difference. Should be ready tomorrow. Thanks for your patience! :persevere:

tiddle commented 8 years ago

Just wondering if there's an update to this?

uglow commented 8 years ago

@tiddle, there's been a few releases since our last conversation. Have you tried the v3.x release? I haven't prioritised getting a Windows VM to investigate further, but I did change the way files are copied (as suggested in my last comment).

If it still doesn't work, I'll look at this tonight.

tiddle commented 8 years ago

Nope. Just tried then. still happening with v3.0

Confit App Generator
? Choose a build-profile for your project Webpack - Webpack-based build profile (23 Dec 2015)
? Supported browsers (required) Latest Versions (major browsers)
Project Path Generator
? Use default/existing paths? Yes
Build CSS Generator
? CSS source format stylus
Build JS Generator
? Source code language ES6
? Target output language ES5
? JavaScript Framework (optional)
? Vendor scripts OR module-names to include (edit in confit.json):
Build HTML Generator
? HTML source file extension? .html
Entry Point Generator
? Entry-points for the application (edit in confit.json):
Dev Server Generator
? Server port 3000
? Server hostname localhost
? Server protocol https
Production Server Generator
? Server port 3000
? Server hostname localhost
? Server protocol https
Release Generator
? Where will this project be hosted? GitHub
? Use semantic releasing? Yes
? Commit message format Conventional
Verify Generator
? JavaScript coding standard none
Sample App Generator
? Create a sample app? Yes
Writing Webpack app options
Writing Webpack buildAssets options
Writing Webpack buildCSS options
Writing Webpack buildJS options
Writing Webpack buildHTML options
Writing Webpack build options
Writing Webpack serverDev options
Writing Grunt serverProd options
Writing Webpack unit-test options
Writing Protractor browser-test options
Writing Grunt verify options
Writing NPM release options
Writing Webpack sampleApp options
AssertionError: Trying to copy from a source that does not exist: C:/Users/carlocr/AppData/Roaming/npm/node_modules/generator-confit/buildTool/webpack/sampleApp/templates/noFramework/ES6/demoModule
    at EditionInterface.exports._copySingle (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:45:3)
    at EditionInterface.<anonymous> (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:38:10)
    at Array.forEach (native)
    at EditionInterface.exports.copy (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:35:9)
    at write (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\buildTool\webpack\sampleApp\sampleApp.js:96:13)
    at module.exports.confitGen.create.writing (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\generators\sampleApp\index.js:88:26)
    at Object.<anonymous> (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\yeoman-generator\lib\base.js:436:25)
    at C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\run-async\index.js:26:25
    at C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\run-async\index.js:25:19
    at C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\yeoman-generator\lib\base.js:448:8
uglow commented 8 years ago

Ok, I'll take a deeper look at this tonight. Thanks for your feedback so far

Sent from my iPhone

On 12 Apr 2016, at 1:35 PM, Carlo Cruz notifications@github.com wrote:

Nope. Just tried then. still happening with v3.0

Confit App Generator ? Choose a build-profile for your project Webpack - Webpack-based build profile (23 Dec 2015) ? Supported browsers (required) Latest Versions (major browsers) Project Path Generator ? Use default/existing paths? Yes Build CSS Generator ? CSS source format stylus Build JS Generator ? Source code language ES6 ? Target output language ES5 ? JavaScript Framework (optional) ? Vendor scripts OR module-names to include (edit in confit.json): Build HTML Generator ? HTML source file extension? .html Entry Point Generator ? Entry-points for the application (edit in confit.json): Dev Server Generator ? Server port 3000 ? Server hostname localhost ? Server protocol https Production Server Generator ? Server port 3000 ? Server hostname localhost ? Server protocol https Release Generator ? Where will this project be hosted? GitHub ? Use semantic releasing? Yes ? Commit message format Conventional Verify Generator ? JavaScript coding standard none Sample App Generator ? Create a sample app? Yes Writing Webpack app options Writing Webpack buildAssets options Writing Webpack buildCSS options Writing Webpack buildJS options Writing Webpack buildHTML options Writing Webpack build options Writing Webpack serverDev options Writing Grunt serverProd options Writing Webpack unit-test options Writing Protractor browser-test options Writing Grunt verify options Writing NPM release options Writing Webpack sampleApp options AssertionError: Trying to copy from a source that does not exist: C:/Users/carlocr/AppData/Roaming/npm/node_modules/generator-confit/buildTool/webpack/sampleApp/templates/noFramework/ES6/demoModule at EditionInterface.exports._copySingle (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:45:3) at EditionInterface. (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:38:10) at Array.forEach (native) at EditionInterface.exports.copy (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\mem-fs-editor\lib\actions\copy.js:35:9) at write (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\buildTool\webpack\sampleApp\sampleApp.js:96:13) at module.exports.confitGen.create.writing (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\generators\sampleApp\index.js:88:26) at Object. (C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\yeoman-generator\lib\base.js:436:25) at C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\run-async\index.js:26:25 at C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\run-async\index.js:25:19 at C:\Users\carlocr\AppData\Roaming\npm\node_modules\generator-confit\node_modules\yeoman-generator\lib\base.js:448:8 — You are receiving this because you were assigned. Reply to this email directly or view it on GitHub

uglow commented 8 years ago

I've been able to reproduce this issue on a WindowsXP VM.

uglow commented 8 years ago

@tiddle - I've verified with the default Confit options that the files are generated. However, the standard NodeJS-on-Windows warnings about not having Python installed occurred. If you've run NodeJS packages that use node-gyp before, it should work. Please try again and let me know how it goes.