mapbox-gl 2.13.0 Windows 10环境下编译
Posted 一醉千秋
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mapbox-gl 2.13.0 Windows 10环境下编译相关的知识,希望对你有一定的参考价值。
1.下载mapbox-gl.js源码包,解压
2.按照源码中CONTRIBUTING.md描述,配置基础环境
[node.js](https://nodejs.org/) version 14,
[yarn](https://yarnpkg.com/en/docs/install#windows-tab),
[npm and node-gyp](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules).
3.更新编译环境依赖
yarn install
4.npm install gl
5.npm install
6.yarn run build-css
7.yarn run build-prod-min
出现如下错误:
postcss.config.cjs
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (H:\\win_share_thor\\26-Mapbox-gl\\trunk\\mapbox-gl-js-2.13.0-win\\node_modules\\browserslist\\index.js:1:18)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
code: 'MODULE_NOT_FOUND',
-----------------------------------------------------------------------------------------------------------------
删除 node_modules下面
caniuse-lite browserslist
然后
npm update
npm install
yarn run build-css
yarn run build-prod-min
以上是关于mapbox-gl 2.13.0 Windows 10环境下编译的主要内容,如果未能解决你的问题,请参考以下文章