编译SuperMap/Vue-iClient3D-WebGL问题

1 说明

源码地址:https://github.com/SuperMap/iClient3D-vue
发布地址:http://support.supermap.com.cn:8090/webgl/examples/component/dist/
示例地址:http://support.supermap.com.cn:8090/webgl/examples/component/examples.html

2 源码编译问题

Q1 Unexpected end of JSON input while parsing near '…"解决方法
A1 解决办法:
(1)npm install --registry=https://registry.npm.taobao.org --loglevel=silly
(2) npm cache clean --force
(3) npm install

Q2 ReferenceError: primordials is not defined
A2 :参考https://blog.csdn.net/sunny_desmond/article/details/107506626
实质为node与gulp版本不兼容问题,我这里使用了nvm来解决这个问题。安装node的11版本
nvm安装包

	// 1、查看本地安装的所有版本;有可选参数available,显示所有可下载的版本。
	nvm list [available]
	// 2、安装,命令中的版本号可自定义,具体参考命令1查询出来的列表
	nvm install 11.13.0
	// 3、使用特定版本
	nvm use 11.13.0
	// 4、卸载
	nvm uninstall 11.13.0

Q3 TypeError: Cannot destructure property createHash of ‘undefined’ or ‘null’
A3 文档编译报错,解决办法另开一个文档的工程,
安装vuepress
配置即可

{
  "name": "cesiumdoc",
  "version": "1.0.0",
  "description": "---\r home: true\r # heroImage: /spider.png\r actionText: 安装 →\r actionLink: /zh/api/guide/installation.md",
  "main": "index.js",
  "scripts": {
    "docs:dev": "vuepress dev docs",
    "docs:build": "vuepress build docs"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "vuepress": "^1.8.0"
  },
  "dependencies": {
    "sass": "^1.32.5",
    "sass-loader": "^10.1.1"
  }
}

3 结束语

node/webpack版本问题,虽然好用敲几个命令就行了,但是版本冲突问题搞的好麻烦

你可能感兴趣的:(AboutFrontend)