angular2-image-gallery icon indicating copy to clipboard operation
angular2-image-gallery copied to clipboard

Error on :Run convert script" - TypeError: invalid options argument

Open rv-github opened this issue 4 years ago • 4 comments

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. (E:\Ravi\Office\Work\Angular\Rv-Marathi\node_modules\angular2-image-gallery\convert.js:318:1) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14)

rv-github avatar Jun 20 '21 08:06 rv-github

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?

Fiehra avatar Jul 06 '21 23:07 Fiehra

for me the script still works while using angular 11 so this error only occurs to me after updating to angular 12

Fiehra avatar Jul 06 '21 23:07 Fiehra

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.

Dan-Lit avatar May 28 '22 21:05 Dan-Lit

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)');
}

Dan-Lit avatar May 28 '22 23:05 Dan-Lit

Thanks @Dan-Lit

Revived this project after quite some time and copied your adjustments into master.

BenjaminBrandmeier avatar Sep 12 '22 19:09 BenjaminBrandmeier