上海软件培训网站建设,如何评价一个网站的网站建设,北京论坛网站建设,网站asp前言
最近新入职了一家公司#xff0c;公司新开了有个未来城市的项目#xff0c;需要用到3D城市建模#xff0c;公司老总选了Mars3d作为前端框架#xff0c;项目分给我了#xff0c;又是一个全新的领域#xff0c;开搞吧#xff01; 下面是自己遇到的几个小问题#x…前言
最近新入职了一家公司公司新开了有个未来城市的项目需要用到3D城市建模公司老总选了Mars3d作为前端框架项目分给我了又是一个全新的领域开搞吧 下面是自己遇到的几个小问题记录一下
1 npm install copy-webpack-plugin --save -dev 时报错
解决办法npm install copy-webpack-plugin --save -dev --legacy-peer-deps 2 第二个小错误就是很简单的粗心了报错代码const path require(‘path’)SyntaxError: Identifier ‘path’ has already been declared解决办法检查一下代码就是自己多写了一遍这个声明语句把重复的代码删除就好了。 3 ERROR TypeError: compilation.getCache is not a function 解决办法出现这个错误一般是我们的webpack和copy-webpack-plugin的版本不匹配导致的这个时候我们只需要删除自己的copy-webpack-plugin然后安装一个低版本的即可这可能是第一个问题安装的后遗症 两条指令卸载npm uninstall copy-webpack-plugin安装我安装的是copy-webpack-plugin5.0.0我的webpack版本是 4 ERROR Error: [copy-webpack-plugin] patterns must be an array 解决办法这个是说我们的配置 new CopyWebpackPlugin()的参数必须是一个数组我们从官网拷贝过来的代码好像是 new CopyWebpackPlugin({patterns: [{ from: path.join(cesiumSourcePath, Workers), to: path.join(config.output.path, cesiumRunPath, Workers) },{ from: path.join(cesiumSourcePath, Assets), to: path.join(config.output.path, cesiumRunPath, Assets) },{ from: path.join(cesiumSourcePath, ThirdParty), to: path.join(config.output.path, cesiumRunPath, ThirdParty) },{ from: path.join(cesiumSourcePath, Widgets), to: path.join(config.output.path, cesiumRunPath, Widgets) }]}),改成这样就好了 new CopyWebpackPlugin([{ from: path.join(cesiumSourcePath, Workers), to: path.join(config.output.path, cesiumRunPath, Workers) },{ from: path.join(cesiumSourcePath, Assets), to: path.join(config.output.path, cesiumRunPath, Assets) },{ from: path.join(cesiumSourcePath, ThirdParty), to: path.join(config.output.path, cesiumRunPath, ThirdParty) },{ from: path.join(cesiumSourcePath, Widgets), to: path.join(config.output.path, cesiumRunPath, Widgets) }])5 These dependencies were not found: turf/turf in ./node_modules/mars3d/dist/mars3d.js *mars3d-cesium in ./node_modules/mars3d/dist/mars3d.js, ./src/main.js To install them, you can run: npm install --save turf/turf mars3d-cesium 这个很简单就跟着运行这条指令就好了。 npm install --save turf/turf mars3d-cesium 6 还有问题我会继续更新