活动介绍
file-type

node-ts-cache模块: TypeScript装饰器支持与缓存策略

ZIP文件

下载需积分: 15 | 235KB | 更新于2024-12-13 | 68 浏览量 | 0 下载量 举报 收藏
download 立即下载
在v4版本中,由于改进进行了重大更改,因此如果您之前使用的是旧版本,则需要查阅对应分支的文档。该缓存模块支持多种存储方式,包括内存、文件系统和基于ioredis的存储。在安装时,可以通过npm安装node-ts-cache包。使用该模块时,开发者可以利用装饰器来缓存函数响应,并且可以自定义缓存策略,如设置过期时间、懒惰删除和永久缓存等选项。" 知识点: 1. 装饰器:在JavaScript和TypeScript中,装饰器是一种特殊类型的声明,它可以被附加到类声明、方法、访问符、属性或参数上。在node-ts-cache中,装饰器被用于缓存函数响应,增强代码的可读性和易用性。 2. 缓存模块:缓存模块用于临时存储数据以加快应用程序的响应速度。node-ts-cache是一个针对Node.js环境设计的缓存解决方案,它允许用户缓存数据,从而减少对数据库或外部服务的调用次数。 3. 可扩展性:node-ts-cache模块具有高度可扩展性,意味着它设计上可以容易地通过插件或接口进行扩展,以适应不同的应用场景和需求。 4. 支持存储方式:该模块支持多种存储方式,包括: - memory:使用内存作为存储介质,提供最快的读写速度,适用于临时数据存储。 - node-fs:基于Node.js的文件系统进行数据存储,适合持久化缓存数据。 - ioredis:利用ioredis库来实现对Redis的支持,Redis是一个开源的使用内存存储数据的高性能键值数据库,适合需要高性能和持久化数据的应用。 5. 缓存策略:node-ts-cache允许自定义缓存策略,具体选项如下: - ttl(生存时间):设置缓存项过期的秒数,默认值为60秒。超过该时间后,缓存项将不再有效。 - isLazy:设置为true时,缓存项只有在被访问时才会检查其是否过期,过期则删除;设置为false时,缓存项会在给定的ttl后自动删除,不需要等待被访问。 - isCachedForever:如果设置为true,则缓存项将被永久存储,不会过期。 6. TypeScript支持:node-ts-cache是用TypeScript编写的,这表示它支持TypeScript的所有特性。TypeScript是JavaScript的一个超集,它添加了静态类型定义等特性,能够提升开发效率和代码的可维护性。 7. 使用示例:在使用node-ts-cache时,可以通过装饰器@Cache来缓存函数的返回值。装饰器可以接收一个容器和一些选项,如ttl、isLazy和isCachedForever等,以及一个可选的calculateKey函数用于自定义缓存键的生成。默认情况下,模块会使用所有函数参数来构建唯一键。 8. 安装与版本:可以通过npm包管理工具来安装node-ts-cache模块。需要注意的是,v4版本由于改进而进行了重大更改,使用旧版本的用户需要切换到对应分支的文档中查看。 在使用node-ts-cache时,开发者应仔细阅读文档,理解不同存储方式的特性以及如何配置缓存策略,以便选择最适合当前应用需求的方案。同时,考虑到TypeScript的支持,开发者在使用该模块时可能需要对TypeScript有一定的了解,以便充分利用其类型安全的特性。

相关推荐

filetype

PS D:\My JAVA\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts> npm list vue [email protected] D:\My JAVA\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts └── (empty) PS D:\My JAVA\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts> npm list vue-area-linkage [email protected] D:\My JAVA\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts └── (empty) { "name": "vue-typescript-admin-template", "version": "0.1.0", "private": true, "author": "Chong Guo <[email protected]>", "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "build:uat": "vue-cli-service build --mode production.uat", "lint": "vue-cli-service lint", "svg": "vsvg -s ./src/icons/svg -t ./src/icons/components --ext ts --es6", "test:e2e": "vue-cli-service test:e2e", "test:unit": "vue-cli-service test:unit" }, "dependencies": { "@types/echarts": "^4.4.6", "@types/webpack": "^4.41.12", "area-data": "^5.0.6", "axios": "^0.19.0", "echarts": "^5.3.2", "element-ui": "^2.12.0", "js-cookie": "^2.2.1", "md5": "^2.3.0", "moment": "^2.24.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", "path-to-regexp": "^3.0.0", "register-service-worker": "^1.6.2", "vue": "^2.6.10", "vue-area-linkage": "^5.1.0", "vue-class-component": "^7.1.0", "vue-property-decorator": "^8.2.2", "vue-router": "^3.1.2", "vue-svgicon": "^3.2.6", "vuex": "^3.1.1", "vuex-class": "^0.3.2", "vuex-module-decorators": "^0.10.1", "vuex-persistedstate": "^2.7.0" }, "devDependencies": { "@types/jest": "^24.0.18", "@types/js-cookie": "^2.2.2", "@types/nprogress": "^0.2.0", "@types/webpack-env": "^1.14.0", "@vue/cli-plugin-babel": "^3.11.0", "@vue/cli-plugin-e2e-cypress": "^3.11.0", "@vue/cli-plugin-eslint": "^3.11.0", "@vue/cli-plugin-pwa": "^3.11.0", "@vue/cli-plugin-typescript": "^3.11.0", "@vue/cli-plugin-unit-jest": "^3.11.0", "@vue/cli-service": "^3.11.0", "@vue/eslint-config-standard": "^4.0.0", "@vue/eslint-config-typescript": "^4.0.0", "@vue/test-utils": "^1.0.0-beta.29", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "^10.0.3", "eslint": "^6.2.2", "eslint-plugin-vue": "^5.2.3", "fibers": "^4.0.2", "jest": "^24.9.0", "sass": "^1.22.10", "sass-loader": "^7.3.1", "style-resources-loader": "^1.2.1", "ts-jest": "^24.0.2", "typescript": "3.6.2", "vue-cli-plugin-element": "^1.0.1", "vue-cli-plugin-style-resources-loader": "^0.1.3", "vue-template-compiler": "^2.6.10", "webpack": "^4.39.3" } }

filetype

• default Electron icon is used reason=application icon is not set • cannot execute chmod error=exec: "chmod": executable file not found in %PATH% • cannot execute chmod error=exec: "chmod": executable file not found in %PATH% • cannot execute chmod error=exec: "chmod": executable file not found in %PATH% ⨯ cannot execute cause=exec: "C:\\Users\\49118\\AppData\\Local\\electron-builder\\Cache\\appimage\\appimage-12.0.1\\linux-x64\\mksquashfs": file does not exist command='C:\Users\49118\AppData\Local\electron-builder\Cache\appimage\appimage-12.0.1\linux-x64\mksquashfs' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\data-dir' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\desktop-common.sh' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\desktop-gnome-specific.sh' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\desktop-init.sh' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\gnome-platform' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\lib' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\usr' 'D:\admin-project\guangxi-quan-vue3\app_dist\__snap-amd64\command.sh' 'D:\admin-project\guangxi-quan-vue3\app_dist\__snap-amd64\meta' 'D:\admin-project\guangxi-quan-vue3\app_dist\__snap-amd64\scripts' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\chrome_100_percent.pak' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\chrome_200_percent.pak' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\chrome_crashpad_handler' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\flowoutdemo' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\icudtl.dat' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libEGL.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libffmpeg.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libGLESv2.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libvk_swiftshader.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libvulkan.so.1' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\locales' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\resources' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\resources.pak' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\snapshot_blob.bin' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\v8_context_snapshot.bin' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\vk_swiftshader_icd.json' 'D:\admin-project\guangxi-quan-vue3\app_dist\flowoutdemo_0.0.0_amd64.snap' -no-progress -quiet -noappend -comp xz -no-xattrs -no-fragments -all-root workingDir= ⨯ cannot execute cause=exec: "C:\\Users\\49118\\AppData\\Local\\electron-builder\\Cache\\appimage\\appimage-12.0.1\\linux-x64\\mksquashfs": file does not exist command='C:\Users\49118\AppData\Local\electron-builder\Cache\appimage\appimage-12.0.1\linux-x64\mksquashfs' 'D:\admin-project\guangxi-quan-vue3\app_dist\__appImage-x64' 'D:\admin-project\guangxi-quan-vue3\app_dist\Electron + Vue3 开发桌面应用-0.0.0.AppImage' -offset 188392 -all-root -noappend -no-progress -quiet -no-xattrs -no-fragments workingDir=D:\admin-project\guangxi-quan-vue3\app_dist\__appImage-x64 ⨯ Cannot cleanup: Error #1 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 2 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:632:26) at ChildProcess.emit (node:events:517:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1098:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5) Error #2 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 2 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:632:26) at ChildProcess.emit (node:events:517:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1098:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5) failedTask=build stackTrace=Error: Cannot cleanup: Error #1 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 2 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:632:26) at ChildProcess.emit (node:events:517:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1098:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5) Error #2 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 2 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:632:26) at ChildProcess.emit (node:events:517:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1098:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5) at throwError (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:88:11) at checkErrors (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:53:9) at AsyncTaskManager.awaitTasks (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:67:7) at processTicksAndRejections (node:internal/process/task_queues:95:5) at D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\platformPackager.ts:189:7 at async Promise.all (index 0) at AsyncTaskManager.awaitTasks (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:65:25) at Packager.doBuild (D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\packager.ts:507:5) at executeFinally (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\promise.ts:12:14) at Packager.build (D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\packager.ts:425:31)

filetype

⨯ symlink usr\share\icons\hicolor\256x256\apps\flowoutdemo.png D:\admin-project\guangxi-quan-vue3\app_dist\__appImage-x64\flowoutdemo.png: A required privilege is not held by the client. github.com/develar/app-builder/pkg/package-format/appimage.copyIcons.func1.1 /Users/runner/work/app-builder/app-builder/pkg/package-format/appimage/appLauncher.go:82 github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2 /Users/runner/work/app-builder/app-builder/pkg/util/async.go:68 runtime.goexit /Users/runner/hostedtoolcache/go/1.21.13/arm64/src/runtime/asm_amd64.s:1650 • cannot execute chmod error=exec: "chmod": executable file not found in %PATH% • cannot execute chmod error=exec: "chmod": executable file not found in %PATH% • cannot execute chmod error=exec: "chmod": executable file not found in %PATH% ⨯ cannot execute cause=exec: "C:\\Users\\49118\\AppData\\Local\\electron-builder\\Cache\\appimage\\appimage-12.0.1\\linux-x64\\mksquashfs": file does not exist command='C:\Users\49118\AppData\Local\electron-builder\Cache\appimage\appimage-12.0.1\linux-x64\mksquashfs' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\data-dir' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\desktop-common.sh' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\desktop-gnome-specific.sh' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\desktop-init.sh' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\gnome-platform' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\lib' 'C:\Users\49118\AppData\Local\electron-builder\Cache\snap\snap-template-electron-4.0-2-amd64\usr' 'D:\admin-project\guangxi-quan-vue3\app_dist\__snap-amd64\command.sh' 'D:\admin-project\guangxi-quan-vue3\app_dist\__snap-amd64\meta' 'D:\admin-project\guangxi-quan-vue3\app_dist\__snap-amd64\scripts' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\chrome_100_percent.pak' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\chrome_200_percent.pak' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\chrome_crashpad_handler' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\flowoutdemo' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\icudtl.dat' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libEGL.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libffmpeg.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libGLESv2.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libvk_swiftshader.so' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\libvulkan.so.1' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\locales' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\resources' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\resources.pak' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\snapshot_blob.bin' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\v8_context_snapshot.bin' 'D:\admin-project\guangxi-quan-vue3\app_dist\linux-unpacked\vk_swiftshader_icd.json' 'D:\admin-project\guangxi-quan-vue3\app_dist\flowoutdemo_0.0.0_amd64.snap' -no-progress -quiet -noappend -comp xz -no-xattrs -no-fragments -all-root workingDir= ⨯ Cannot cleanup: Error #1 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:639:26) at ChildProcess.emit (node:events:524:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1104:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) Error #2 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 2 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:639:26) at ChildProcess.emit (node:events:524:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1104:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) failedTask=build stackTrace=Error: Cannot cleanup: Error #1 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:639:26) at ChildProcess.emit (node:events:524:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1104:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) Error #2 -------------------------------------------------------------------------------- Error: D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 2 at ChildProcess.<anonymous> (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\util.ts:259:14) at Object.onceWrapper (node:events:639:26) at ChildProcess.emit (node:events:524:28) at ChildProcess.cp.emit (D:\admin-project\guangxi-quan-vue3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1104:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) at throwError (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:88:11) at checkErrors (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:53:9) at AsyncTaskManager.awaitTasks (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:67:7) at processTicksAndRejections (node:internal/process/task_queues:95:5) at D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\platformPackager.ts:189:7 at async Promise.all (index 0) at AsyncTaskManager.awaitTasks (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\asyncTaskManager.ts:65:25) at Packager.doBuild (D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\packager.ts:507:5) at executeFinally (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\promise.ts:12:14) at Packager.build (D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\packager.ts:425:31)

filetype

{ "name": "my-project1", "version": "0.1.0", "private": true, "scripts": { "start": "voyo-run --config global/command/main-command.js", "exportB64Json": "node tool/base64-icons/convert.js" }, "sideEffects": [ "*.vue", "*.wxss", "*.css", "*.scss", "*.websass", "**/*.module.ts", "src/init.js" ], "dependencies": { "@dcloudio/uni-app-plus": "^2.0.0-28920200907001", "@dcloudio/uni-cli-i18n": "^2.0.2-4060620250520001", "@dcloudio/uni-h5": "^2.0.0-28920200907001", "@dcloudio/uni-helper-json": "*", "@dcloudio/uni-i18n": "^2.0.1-34920220630001", "@dcloudio/uni-mp-360": "^2.0.0-28920200907001", "@dcloudio/uni-mp-alipay": "^2.0.0-28920200907001", "@dcloudio/uni-mp-baidu": "^2.0.0-28920200907001", "@dcloudio/uni-mp-qq": "^2.0.0-28920200907001", "@dcloudio/uni-mp-toutiao": "^2.0.0-28920200907001", "@dcloudio/uni-mp-vue": "^2.0.0-28920200907001", "@dcloudio/uni-mp-weixin": "^2.0.0-28920200907001", "@dcloudio/uni-quickapp-native": "^2.0.0-28920200907001", "@dcloudio/uni-quickapp-webview": "^2.0.0-28920200907001", "@dcloudio/uni-stat": "^2.0.0-28920200907001", "@dcloudio/uni-ui": "^1.4.19", "@types/crypto-js": "^4.0.1", "@voyo/core": "^1.0.0", "@voyo/core-style": "^2.5.4", "@voyo/http": "^3.5.2", "@voyo/ui-uni": "2.5.5", "@vue/shared": "^3.0.0-rc.4", "@ztwx/form": "^2.1.0", "@ztwx/webfont": "^0.0.1", "aes-js": "^3.1.2", "core-js": "^3.6.5", "crypto-js": "^4.1.1", "flyio": "^0.6.2", "js-base64": "^2.6.3", "regenerator-runtime": "^0.12.1", "vue": "^2.6.11", "vue-class-component": "^6.3.2", "vue-property-decorator": "^8.5.1", 下午1:45:50 error in ./src/info.ts Syntax Error: TypeError: loaderContext.getOptions is not a function @ ./src/main.js 8:0-30 122:0-4 123:0-4 Build failed with errors.

filetype
filetype

PS D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts> cnpm install / [18/53] Installing workbox-sw@^3.6.3 WARN node unsupported "[email protected]" is incompatible with @vue/[email protected][email protected] › @types/[email protected] › @types/[email protected] › minimatch@*, expected node@20 || >=22 \ [20/53] Installing jsesc@~3.0.2[npminstall:download:npm] Ignore invalid cache file C:\Users\liuchaokun\.npminstall_tarball\manifests\b\a\4\ba4fb9d2cfccee2af987f2b069ef7fda.json - [20/53] Installing safer-buffer@~2.1.0 WARN node unsupported "[email protected]" is incompatible with @vue/[email protected][email protected] › @types/[email protected] › @types/[email protected][email protected] › @isaacs/brace-expansion@^5.0.0, expected node@20 || >=22 \ [21/53] Installing minimalistic-assert@^1.0.0 WARN node unsupported "[email protected]" is incompatible with @vue/[email protected][email protected] › @types/[email protected] › @types/[email protected][email protected] › @isaacs/[email protected] › @isaacs/balanced-match@^4.0.1, expected node@20 || >=22 √ Installed 53 packages √ Linked 1390 latest versions [1/7] scripts.install fibers@^4.0.2 run "node build.js || nodejs build.js", root: "D:\\前端\\苍穹外卖\\前端源码\\苍穹外卖前端源码\\project-sky-admin-vue-ts\\node_modules\\[email protected]@fibers" D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts\node_modules\[email protected]@fibers>node "D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\npminstall\node-gyp-bin\\node-gyp.js" rebuild --release gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder.<anonymous> (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at callback (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\graceful-fs\polyfills.js:306:20) gyp ERR! stack at FSReqCallback.oncomplete (node:fs:202:21) gyp ERR! System Windows_NT 10.0.22000 gyp ERR! command "D:\\My Software\\nodejs\\node.exe" "D:\\My Software\\nvm\\nvm\\v16.20.2\\node_modules\\cnpm\\node_modules\\npminstall\\node-gyp-bin\\node-gyp.js" "rebuild" "--release" gyp ERR! cwd D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts\node_modules\[email protected]@fibers gyp ERR! node -v v16.20.2 gyp ERR! node-gyp -v v4.0.0 gyp ERR! not ok node-gyp exited with code: 1 Please make sure you are using a supported platform and node version. If you would like to compile fibers on this machine please make sure you have setup your build environment-- Windows + OS X instructions here: https://github.com/nodejs/node-gyp Ubuntu users please run: `sudo apt-get install g++ build-essential` RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'` Alpine users please run: `sudo apk add python make g++` 'nodejs' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 [npminstall:runscript:error] fibers@^4.0.2 scripts.install run "node build.js || nodejs build.js" error: Error [RunScriptError]: Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1 at ChildProcess.<anonymous> (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\runscript\index.js:114:21) at ChildProcess.emit (node:events:513:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) { stdio: [Object], exitcode: 1 } × Install fail! RunScriptError: post install error, please remove node_modules before retry! Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1 RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1 at ChildProcess.<anonymous> (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\runscript\index.js:114:21) at ChildProcess.emit (node:events:513:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) npminstall version: 5.8.1 npminstall args: D:\My Software\nodejs\node.exe D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\liuchaokun\.cnpmrc --disturl=https://npmmirror.com/mirrors/node --registry=https://registry.npmmirror.com

filetype

妈的,之前明明成功了呀! PS D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts> cnpm install √ Linked 260 latest versions fallback to D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts\node_modules\.store\node_modules √ Linked 15 public hoist packages to D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts\node_modules deprecate vue@^2.6.14 Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details. deprecate eslint@^6.2.2 This version is no longer supported. Please see https://eslint.org/version-support for other options. deprecate @types/[email protected] › @types/zrender@* This is a stub types definition. zrender provides its own type definitions, so you do not need this installed. deprecate [email protected][email protected][email protected][email protected] Rimraf versions prior to v4 are no longer supported deprecate [email protected][email protected][email protected] › core-js@^2.4.0 core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. Recently updated (since 2025-07-22): 1 packages (detail see file D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts\node_modules\.recently_updates.txt) √ Run 1 script(s) in 93ms. √ Installed 52 packages on D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts √ All packages installed (174 packages installed from npm registry, used 7s(network 7s), speed 786.61KB/s, json 130(986.45KB), tarball 4.23MB, manifests cache hit 131, etag hit 131 / miss 3) 我明明什么都没做,为什么就又不行了! PS D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts> cnpm install / [18/53] Installing workbox-sw@^3.6.3 WARN node unsupported "[email protected]" is incompatible with @vue/[email protected][email protected] › @types/[email protected] › @types/[email protected] › minimatch@*, expected node@20 || >=22 \ [20/53] Installing jsesc@~3.0.2[npminstall:download:npm] Ignore invalid cache file C:\Users\liuchaokun\.npminstall_tarball\manifests\b\a\4\ba4fb9d2cfccee2af987f2b069ef7fda.json - [20/53] Installing safer-buffer@~2.1.0 WARN node unsupported "[email protected]" is incompatible with @vue/[email protected][email protected] › @types/[email protected] › @types/[email protected][email protected] › @isaacs/brace-expansion@^5.0.0, expected node@20 || >=22 \ [21/53] Installing minimalistic-assert@^1.0.0 WARN node unsupported "[email protected]" is incompatible with @vue/[email protected][email protected] › @types/[email protected] › @types/[email protected][email protected] › @isaacs/[email protected] › @isaacs/balanced-match@^4.0.1, expected node@20 || >=22 √ Installed 53 packages √ Linked 1390 latest versions [1/7] scripts.install fibers@^4.0.2 run "node build.js || nodejs build.js", root: "D:\\前端\\苍穹外卖\\前端源码\\苍穹外卖前端源码\\project-sky-admin-vue-ts\\node_modules\\[email protected]@fibers" D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts\node_modules\[email protected]@fibers>node "D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\npminstall\node-gyp-bin\\node-gyp.js" rebuild --release gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder.<anonymous> (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at callback (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\graceful-fs\polyfills.js:306:20) gyp ERR! stack at FSReqCallback.oncomplete (node:fs:202:21) gyp ERR! System Windows_NT 10.0.22000 gyp ERR! command "D:\\My Software\\nodejs\\node.exe" "D:\\My Software\\nvm\\nvm\\v16.20.2\\node_modules\\cnpm\\node_modules\\npminstall\\node-gyp-bin\\node-gyp.js" "rebuild" "--release" gyp ERR! cwd D:\前端\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts\node_modules\[email protected]@fibers gyp ERR! node -v v16.20.2 gyp ERR! node-gyp -v v4.0.0 gyp ERR! not ok node-gyp exited with code: 1 Please make sure you are using a supported platform and node version. If you would like to compile fibers on this machine please make sure you have setup your build environment-- Windows + OS X instructions here: https://github.com/nodejs/node-gyp Ubuntu users please run: `sudo apt-get install g++ build-essential` RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'` Alpine users please run: `sudo apk add python make g++` 'nodejs' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 [npminstall:runscript:error] fibers@^4.0.2 scripts.install run "node build.js || nodejs build.js" error: Error [RunScriptError]: Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1 at ChildProcess.<anonymous> (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\runscript\index.js:114:21) at ChildProcess.emit (node:events:513:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) { stdio: [Object], exitcode: 1 } × Install fail! RunScriptError: post install error, please remove node_modules before retry! Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1 RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1 at ChildProcess.<anonymous> (D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\runscript\index.js:114:21) at ChildProcess.emit (node:events:513:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) npminstall version: 5.8.1 npminstall args: D:\My Software\nodejs\node.exe D:\My Software\nvm\nvm\v16.20.2\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\liuchaokun\.cnpmrc --disturl=https://npmmirror.com/mirrors/node --registry=https://registry.npmmirror.com

filetype

Now using node v16.20.2 (64-bit) PS D:\project-sky-admin-vue-ts3> dir node_modules\@vue\cli-service\bin dir : 找不到路径“D:\project-sky-admin-vue-ts3\node_modules\@vue\cli-service\bin”,因为该路径不存在。 所在位置 行:1 字符: 1 + dir node_modules\@vue\cli-service\bin + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (D:\project-sky-...cli-service\bin:String) [Get-ChildItem], ItemNotFound Exception + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand PS D:\project-sky-admin-vue-ts3> dir node_modules\@vue\cli-service dir : 找不到路径“D:\project-sky-admin-vue-ts3\node_modules\@vue\cli-service”,因为该路径不存在。 所在位置 行:1 字符: 1 + dir node_modules\@vue\cli-service + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (D:\project-sky-...vue\cli-service:String) [Get-ChildItem], ItemNotFound Exception + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand PS D:\project-sky-admin-vue-ts3> dir node_modules\@vue dir : 找不到路径“D:\project-sky-admin-vue-ts3\node_modules\@vue”,因为该路径不存在。 所在位置 行:1 字符: 1 + dir node_modules\@vue + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (D:\project-sky-...de_modules\@vue:String) [Get-ChildItem], ItemNotFound Exception + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand PS D:\project-sky-admin-vue-ts3> dir node_modules\@vue dir : 找不到路径“D:\project-sky-admin-vue-ts3\node_modules\@vue”,因为该路径不存在。 所在位置 行:1 字符: 1 + dir node_modules\@vue + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (D:\project-sky-...de_modules\@vue:String) [Get-ChildItem], ItemNotFound Exception + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand PS D:\project-sky-admin-vue-ts3> dir node_modules 目录: D:\project-sky-admin-vue-ts3\node_modules Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2025/7/29 13:10 .bin d----- 2025/7/29 12:43 array-buffer-byte-length d----- 2025/7/29 12:43 deasync d----- 2025/7/29 13:02 is-weakset

filetype

以上方案,根据以下package.json配置{ "private": true, "scripts": { "analyze": "cross-env ANALYZE=1 umi build", "start": "cross-env UMI_ENV=local umi dev", "build:dev": "cross-env UMI_ENV=dev umi build", "build:test": "cross-env UMI_ENV=test umi build", "build:uat": "cross-env UMI_ENV=uat umi build", "build:prod": "cross-env UMI_ENV=prod umi build", "check:model": "umi dva list model", "postinstall": "umi generate tmp", "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", "test": "umi-test", "test:coverage": "umi-test --coverage" }, "gitHooks": { "pre-commit": "lint-staged" }, "engines": { "node": ">= 16.14.0" }, "lint-staged": { "*.{js,jsx,less,md,json}": [ "prettier --write" ], "*.ts?(x)": [ "prettier --parser=typescript --write" ] }, "dependencies": { "@ant-design/pro-layout": "^6.5.0", "antd": "4.24.0", "antd-img-crop": "^3.16.0", "axios": "^1.6.8", "braft-editor": "^2.3.9", "braft-extensions": "^0.1.1", "classnames": "^2.2.6", "clipboard": "^2.0.8", "crypto-js": "^4.1.1", "dva-model-extend": "^0.1.2", "easy-email-core": "^4.16.1", "easy-email-editor": "^4.16.1", "jsencrypt": "3.2.1", "less-vars-to-js": "^1.3.0", "locales": "^0.0.2", "lodash": "^4.17.21", "lrz": "^4.9.41", "mjml-browser": "^4.15.3", "moment": "^2.25.3", "nprogress": "^0.2.0", "react": "17.0.0", "react-color": "^2.19.3", "react-dnd": "^14.0.4", "react-dom": "17.0.0", "react-final-form": "^6.5.9", "react-webcam": "^7.2.0", "store": "2.0.12", "umi": "3.5.20", "yarn": "^1.22.22" }, "devDependencies": { "@lingui/babel-preset-react": "^2.9.0", "@types/crypto-js": "^4.0.2", "@types/lodash": "^4.14.176", "@types/nprogress": "^0.2.0", "@types/qs": "^6.9.7", "@types/react": "17.0.0", "@types/react-dom": "17.0.0", "@typescript-eslint/eslint-plugin": "^5.2.0", "@typescript-eslint/parser": "^5.2.0", "@umijs/preset-react": "^2.1.7", "cross-env": "^7.0.3", "eslint": "^8.1.0", "eslint-plugin-react": "^7.26.1", "lint-staged": "^10.0.7", "prettier": "^2.2.0", "typescript": "^4.1.2", "yorkie": "^2.0.0", "zip-webpack-plugin": "^4.0.1" }, "resolutions": { "@types/react": "17.0.0", "@types/react-dom": "17.0.0", "immer": "9.0.7" }, "preinstall": "npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions" },重新制定方案

MaDaniel
  • 粉丝: 2098
上传资源 快速赚钱