Angular-RU / angular-cli-webpack

Webpack configuration modifier for @angular/cli
MIT License
67 stars 5 forks source link

fixing error running in a folder with space characters #25

Closed ccaodiug closed 6 years ago

ccaodiug commented 6 years ago

facing an issue when running ngw in a windows 10 environment (didn't try other OS) and having the full path of my repository that contains a folder with a space character in its name. Changing the folder name it works as expected but this is a little bit annoying. The error message is below.

Not working folder C:\Users\myuser\Documents\myfolder\GIT Repos\myrepo

Working folder path C:\Users\myuser\Documents\myfolder\GITRepos\myrepo

module.js:549
    throw err;
    ^

Error: Cannot find module 'C:\Users\myuser\Documents\myfolder\GIT'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
child_process.js:644
    throw err;
    ^

Error: Command failed: node C:\Users\myuser\Documents\myfolder\GIT Repos\myrepo\node_modules\ngw\node_modules\ts-node\dist\bin.js C:\Users\myuser\Documents\myfolder\GIT Repos\myrepo\node_modules\ngw\lib\index.js build --aot=true --base-href=/app/
    at checkExecSyncError (child_process.js:601:13)
    at execSync (child_process.js:641:13)
    at Object.<anonymous> (C:\Users\myuser\Documents\myfolder\GIT Repos\myrepo\node_modules\ngw\bin\ngw:14:9)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)

got a solution changing line 12 from const executionPoint = [tsNodePath, entryPointPath].concat(ngCommandArgs).join(' ');

to const executionPoint = '"'+[tsNodePath, entryPointPath].concat(ngCommandArgs).join('" "')+'"';

ivanpadavan commented 6 years ago

I cannot just mege it, because there are versions for angular 5 and 6.

ccaodiug commented 6 years ago

Thanks ivanpadavan! So, what is your branching strategy to deal with new changes for both versions? if no one is in place, I suggest to proceed (for this change only) by merging it in master (supposed to be angular 6 version), then cherry pick the commit in angular 5 branch and any other branch that is required to be aligned. For future changes, it would be great to design a branching strategy and explain it inside the readme.

regards

splincode commented 6 years ago

@ccaodiug please add test for current pull request

ccaodiug commented 6 years ago

@splincode please, let me know which kind of test you need for it.

ccaodiug commented 6 years ago

@ivanpadavan please, could you explain me why did you reject the request? I'm trying to understand how to provide the request to solve your concerns and which test @splincode requires, this in order to provide to him and you everything you need. Even, I think to have a workspace completely free of space characters is a heavy limitation for everyone that what to use ngw and this limitation should be fix.