Error on :Run convert script" - TypeError: invalid options argument
PS E:\Ravi\Office\Work\Angular\Rv-Marathi> node node_modules/angular2-image-gallery/convert.js /assets/images/decorations/gallery
Images will be scanned from this location: /assets/images/decorations/gallery/
Images will be exported to this location: E:\Ravi\Office\Work\Angular\Rv-Marathi/src/assets/img/gallery/
Images will be expected during runtime at this location:
assets/img/gallery/
No sorting mechanism specified! Default mode will be sorting by file name.
Creating folder structure... E:\Ravi\Office\Work\Angular\Rv-Marathi\node_modules\mkdirp\lib\opts-arg.js:13 throw new TypeError('invalid options argument') ^
TypeError: invalid options argument
at optsArg (E:\Ravi\Office\Work\Angular\Rv-Marathi\node_modules\mkdirp\lib\opts-arg.js:13:11)
at Function.mkdirpSync [as sync] (E:\Ravi\Office\Work\Angular\Rv-Marathi\node_modules\mkdirp\index.js:19:10)
at createFolderStructure (E:\Ravi\Office\Work\Angular\Rv-Marathi\node_modules\angular2-image-gallery\convert.js:96:12)
at convert (E:\Ravi\Office\Work\Angular\Rv-Marathi\node_modules\angular2-image-gallery\convert.js:85:5)
at init (E:\Ravi\Office\Work\Angular\Rv-Marathi\node_modules\angular2-image-gallery\convert.js:81:5)
at Object.
can confirm this issue when running convert script. only since a few days ago script command didn change. maybe dependency problem? anyone workaround for this?
for me the script still works while using angular 11 so this error only occurs to me after updating to angular 12
for me the script still works while using angular 11 so this error only occurs to me after updating to angular 12
I downgraded @angular/cli to 11.1.2 but still not working.
I got it! This package is using mkdirp old syntax, which no longer works (https://github.com/isaacs/node-mkdirp/issues/26).
So you can either: -Manually change the old method in the convert.js file to its current syntax (code below). -Switch to an older Angular version (didn't check, but probably 8 would do the trick).
function createFolderStructure() {
console.log('\nCreating folder structure...');
mkdirp.sync(assetsAbsoluteBasePath);
for (var i in resolutions) {
mkdirp.sync(assetsAbsoluteBasePath + resolutions[i].name);
}
console.log('...done (folder structure)');
}
Thanks @Dan-Lit
Revived this project after quite some time and copied your adjustments into master.