Installation fails with "TypeError: lookups.flatMap is not a function"
jdfinch opened this issue · 4 comments
jdfinch commented
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
What node version are you on?
retorquere commented
Look like yeoman/yo#678
jdfinch commented
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
Everything works after making sure to install nodejs version 16.