node.js安装

Node.js下载安装及环境配置教程【超详细】_nodejs下载_WHF__的博客-CSDN博客

进入官网地址下载安装包 https://nodejs.org/zh-cn/download/

选择对应你系统的Node.js版本,这里我选择的是Windows系统、64位

npm配置

采用国外的npm源,下载不动。

换成淘宝的源。(PS:家里的移动宽带网络有点问题,发了两个Wifi网络,一个是xx命名,一个是xx-5G的,开始默认连接xx-5G始终下载不了,换成另外一个就好了。)

下载Cesium最新版本https://cesium.com/downloads/

解压下载的Cesium-1.107.zip到文件夹D:\CesiumExp\CesiumJS,进入该目录,执行命令cnpm install,编译Cesium。(PS:后改为1.88版本)

之后会再目录中生成node_moudles文件夹。

C:\Users\yhexie>npm install -g cnpm --registry=https://registry.npmmirror.com

added 449 packages in 19s

28 packages are looking for funding
run `npm fund` for details

C:\Users\yhexie>d:

D:\>cd D:\CesiumExp\CesiumJS

D:\CesiumExp\CesiumJS>cnpm install
√ Linked 33 latest versions fallback to D:\CesiumExp\CesiumJS\packages\engine\node_modules\.store\node_modules
Recently updated (since 2023-06-27): 3 packages (detail see file D:\CesiumExp\CesiumJS\packages\engine\node_modules\.recently_updates.txt)
√ Run 1 script(s) in 168ms.
√ Installed 18 packages on D:\CesiumExp\CesiumJS\packages\engine
√ All packages installed (33 packages installed from npm registry, used 3s(network 3s), speed 1.8MB/s, json 33(726.31KB), tarball 4.82MB, manifests cache hit 0, etag hit 0 / miss 0)

√ Linked 1 latest versions fallback to D:\CesiumExp\CesiumJS\packages\widgets\node_modules\.store\node_modules
√ Installed 2 packages on D:\CesiumExp\CesiumJS\packages\widgets
√ All packages installed (1 packages installed from npm registry, used 191ms(network 187ms), speed 104.75KB/s, json 1(1.34KB), tarball 18.25KB, manifests cache hit 0, etag hit 0 / miss 0)

√ Linked 836 latest versions fallback to D:\CesiumExp\CesiumJS\node_modules\.store\node_modules
√ Linked 35 public hoist packages to D:\CesiumExp\CesiumJS\node_modules
deprecate request@^2.79.0 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate gulp@4.0.2 › glob-watcher@5.0.5 › chokidar@^2.0.0 Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
deprecate request@2.88.2 › har-validator@~5.1.3 this library is no longer supported
deprecate request@2.88.2 › uuid@^3.3.2 Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
deprecate rollup-plugin-strip-pragma@1.0.0 › magic-string@0.25.9 › sourcemap-codec@^1.4.8 Please use @jridgewell/sourcemap-codec instead
deprecate gulp@4.0.2 › glob-watcher@5.0.5 › anymatch@2.0.0 › micromatch@3.1.10 › snapdragon@0.8.2 › source-map-resolve@^0.5.0 See https://github.com/lydell/source-map-resolve#deprecated
deprecate gulp@4.0.2 › glob-watcher@5.0.5 › anymatch@2.0.0 › micromatch@3.1.10 › snapdragon@0.8.2 › source-map-resolve@0.5.3 › source-map-url@^0.4.0 See https://github.com/lydell/source-map-url#deprecated
deprecate gulp@4.0.2 › glob-watcher@5.0.5 › anymatch@2.0.0 › micromatch@3.1.10 › snapdragon@0.8.2 › source-map-resolve@0.5.3 › urix@^0.1.0 Please see https://github.com/lydell/urix#deprecated
deprecate gulp@4.0.2 › glob-watcher@5.0.5 › anymatch@2.0.0 › micromatch@3.1.10 › snapdragon@0.8.2 › source-map-resolve@0.5.3 › resolve-url@^0.2.1 https://github.com/lydell/resolve-url#deprecated
Recently updated (since 2023-06-27): 61 packages (detail see file D:\CesiumExp\CesiumJS\node_modules\.recently_updates.txt)
Today:
→ @rollup/plugin-terser@0.4.3 › terser@5.18.2 › @jridgewell/source-map@^0.3.3(0.3.5) (03:07:28)
→ istanbul-lib-instrument@5.2.1 › @babel/core@^7.12.3(7.22.6) (15:49:02)
→ istanbul-lib-instrument@5.2.1 › @babel/parser@^7.14.7(7.22.6) (15:48:49)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @nicolo-ribaudo/semver-v6@^6.3.3(6.3.3) (02:11:38)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @babel/helper-compilation-targets@^7.22.6(7.22.6) (15:48:58)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @babel/helper-module-transforms@7.22.5 › @babel/helper-split-export-declaration@^7.22.5(7.22.6) (15:48:49)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @babel/helper-compilation-targets@7.22.6 › @babel/compat-data@^7.22.6(7.22.6) (15:48:48)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @babel/helpers@^7.22.6(7.22.6) (15:49:00)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @babel/traverse@^7.22.6(7.22.6) (15:48:59)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @babel/helper-compilation-targets@7.22.6 › browserslist@4.21.9 › electron-to-chromium@^1.4.431(1.4.449) (06:02:29)
→ istanbul-lib-instrument@5.2.1 › @babel/core@7.22.6 › @babel/helper-compilation-targets@7.22.6 › browserslist@4.21.9 › caniuse-lite@^1.0.30001503(1.0.30001512) (06:47:37)
√ Run 2 script(s) in 2s.
√ Installed 63 packages on D:\CesiumExp\CesiumJS
√ All packages installed (978 packages installed from npm registry, used 35s(network 33s), speed 1.53MB/s, json 855(9.65MB), tarball 40.02MB, manifests cache hit 3, etag hit 0 / miss 0)

 

D:\CesiumExp\CesiumJS>


启动服务

node server.js

在浏览器输入:http://localhost:8080/