fonts icon indicating copy to clipboard operation
fonts copied to clipboard

npm install failing

Open abdullahsumbal opened this issue 4 years ago • 11 comments

I got this error message when running npm install

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/fontnik/v0.5.0/Release/node-v64-linux-x64.tar.gz

Changing npm package fontnik version to v0.5.3 in the package.json fixed the problem for me.

abdullahsumbal avatar Jul 15 '19 09:07 abdullahsumbal

@abdullahsumbal Just tried the same. Changing the fontnik version did not work for me. Still have an error :( Any ideas?

1834 verbose stack Error: [email protected] install: `node-pre-gyp install --fallback-to-build=true`
1834 verbose stack Exit status 1
1834 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:326:16)
1834 verbose stack     at EventEmitter.emit (events.js:209:13)
1834 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
1834 verbose stack     at ChildProcess.emit (events.js:209:13)
1834 verbose stack     at maybeClose (internal/child_process.js:1021:16)
1834 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
1835 verbose pkgid [email protected]
1836 verbose cwd /Users/georgbachmann/Desktop/maps(cjsx8odu41loz1fjxg5t510eg)
1837 verbose Darwin 18.7.0
1838 verbose argv "/usr/local/Cellar/node/12.9.1/bin/node" "/usr/local/bin/npm" "install"
1839 verbose node v12.9.1
1840 verbose npm  v6.10.3
1841 error code ELIFECYCLE
1842 error errno 1
1843 error [email protected] install: `node-pre-gyp install --fallback-to-build=true`
1843 error Exit status 1
1844 error Failed at the [email protected] install script.

georgbachmann avatar Aug 29 '19 11:08 georgbachmann

@georgbachmann, I just recloned and did npm install again. It works for me. Which operating system are you using?

I have a Ubuntu 16.04.6 LTS system with node v10.16.3 and npm v6.9.0.

abdullahsumbal avatar Aug 30 '19 04:08 abdullahsumbal

I am on MacOS 10.14.6. Node V12.9.1 and npm 6.10.3 Is there a docker-version available somewhere as well? Couldn'd find one :(

georgbachmann avatar Aug 30 '19 05:08 georgbachmann

Hey @georgbachmann, I dont have a Mac, so I can not test it. If you just need the generated fonts from this repo. I have put the generated fonts on this link https://abdullahsumbal.com/Doc/fonts.zip

abdullahsumbal avatar Sep 07 '19 22:09 abdullahsumbal

@abdullahsumbal Thanks for your help, but I'd need my own fonts unfortunately...

georgbachmann avatar Sep 09 '19 05:09 georgbachmann

Running npm i fontnik has fixed this for us.

My npm-foo isn't great so I've not the faintest clue why it can't just resolve the package from the package.lock file but there you go.

JamJar00 avatar Sep 11 '19 14:09 JamJar00

openmaptiles/font uses fontnik. fontnik installs only with supported node versions. See https://github.com/mapbox/node-fontnik/blob/master/README.md for a list of supported node versions.

Build from source does not work because of a missing C++ flag somewhere (-DBOOST_MATH_DISABLE_FLOAT128), see UCL/STIR#209

I was able to solve the problem by switching to node version 6.17.1:

nvm install v6.17.1
rm -rf node_modules
npm install
node generate.js

anneb avatar Oct 19 '19 00:10 anneb

For the benefit of anyone trying to do this on a Mac... just don't. Spent way too many hours on it this afternoon.

I've installed it on an Ubuntu 16.04 VM and it works fine using @anneb's version suggestion.

systemed avatar May 20 '20 16:05 systemed

It worked flawlessly for me on macOS Big Sur 11.2.3 and Node v14.15.4.

jvolker avatar Apr 13 '21 11:04 jvolker

after cloning the repo, npm install throws this error for me:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(24 1,5): error MSB8066: Custom build for '..\scripts\install_deps.sh' exited with code 1. [D:\code\node-fontnik\build\acti on_before_build.vcxproj]"

On Win 10, Node v16.7

I have installed Visual Studio 2019 (some basic stuff for C++) and "Microsoft.CppCommon.targets" does exist in that directory... but it's still throwing an error.

Thoughts? I'm sure there are others that have run into this...

freeseus avatar Apr 21 '23 06:04 freeseus

Nevermind. Found a different solution.

For anyone looking to find an online conversion from a regular font (.TTF for example) to PBF, just use: https://maplibre.org/font-maker/

Hope that's helpful.

freeseus avatar Apr 21 '23 07:04 freeseus