retorquere / generator-zotero-plugin

Generate zotero plugin build scaffolding
MIT License
30 stars 7 forks source link

Installation fails with "TypeError: lookups.flatMap is not a function" #19

Closed jdfinch closed 2 years ago

jdfinch commented 2 years ago

I ran installation instructions verbatim on Ubuntu 20.04.3 LTS:

sudo apt-get install npm
npm install -g npm@latest

npm install -g yo
npm install -g generator-zotero-plugin
mkdir zotero-my-fantastic-plugin
cd zotero-my-fantastic-plugin
yo zotero-plugin

Command failed with the following:

(base) james:ZoteroNavigate$ yo zotero-plugin
/home/james/.npm-global/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:69
    filePatterns: lookups.flatMap(prefix => [`${prefix}/*/index.ts`, `${prefix}/*/index.js`, `${prefix}/*/index.cjs`, `${prefix}/*/index.mjs`]),
                          ^

TypeError: lookups.flatMap is not a function
    at Environment.resolver.lookup (/home/james/.npm-global/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:69:27)
    at init (/home/james/.npm-global/lib/node_modules/yo/lib/cli.js:130:7)
    at pre (/home/james/.npm-global/lib/node_modules/yo/lib/cli.js:89:3)
    at Object.<anonymous> (/home/james/.npm-global/lib/node_modules/yo/lib/cli.js:219:3)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
retorquere commented 2 years ago

What node version are you on?

retorquere commented 2 years ago

Look like https://github.com/yeoman/yo/issues/678

jdfinch commented 2 years ago

Yea it looks like a versioning problem. I have

(base) james:ZoteroNavigate$ npm -v
6.14.4
(base) james:ZoteroNavigate$ node -v
v10.19.0
(base) james:ZoteroNavigate$ yo --version
4.3.0

Not sure why the latest versions didn't get installed. Thanks, trying again...

jdfinch commented 2 years ago

Everything works after making sure to install nodejs version 16.