basemaps
basemaps copied to clipboard
npm install @basemap/sprites is missing modules
Bug Description
When following the install instructions for @basemaps/sprites
, you get an unusable install
Steps to Reproduce
Steps to reproduce the behavior:
-
npm install @basemaps/sprites
-
node_modules/.bin/basemaps-sprites
You get the error
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'fs' imported from /home/pnorman/spirit/node_modules/@basemaps/sprites/build/cli.js
at packageResolve (internal/modules/esm/resolve.js:664:9)
at moduleResolve (internal/modules/esm/resolve.js:705:18)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:798:11)
at Loader.resolve (internal/modules/esm/loader.js:100:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:246:28)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:47:40)
at link (internal/modules/esm/module_job.js:46:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Versions installed are
npm list
spirit@ /home/pnorman/spirit
└── @basemaps/[email protected]
Hi @pnorman, I have attempted to reproduce this issue, I started from a fresh nodejs docker container and it all worked fine.
Here are the commands I ran.
docker run -it node:18 /bin/bash
mkdir test-folder
cd test-folder
npm init --yes
npm install @basemaps/sprites
node_modules/.bin/basemaps-sprites --help
Could you provide more information about your nodejs versions and system setup?
pnorman@took:~/sprites_test$ npm --version
7.5.2
pnorman@took:~/sprites_test$ nodejs --version
v12.22.12
This is on a clean Debian stable release
Node v12 reached end of life in April 2022 https://github.com/nodejs/release#release-schedule Node v14 will each end of life at the end of April 2023,
The current LTS is v18, We only test back to node v16, However as far as I can v14 works as expected.
I see the docs mention > v12, I will update that.
engines
should also be set in package.json if there are minimum versions - Debian and Ubuntu LTS both have Node 12 in their latest release, so it's fairly common.
engines
should also be set in package.json if there are minimum versions
It is currently set as the default for what is needed for ESM.
I have made https://github.com/linz/basemaps/pull/2749 which will allow node12 to work with sprites. But then I have also made a PR to say that we only support node>16 with the engines https://github.com/linz/basemaps/pull/2748
But considering that it was EOL'd a year ago, I would highly recommend using something like fnm
or n
to install a current LTS.