jamebal / jmal-cloud-view

JmalCloud It's a private cloud storage project that makes it simple and secure to manage your files in the cloud. JmalCloud 是一款私有云存储网盘项目,能够简单安全管理您的云端文件
https://jmalcloud.github.io
MIT License
650 stars 133 forks source link

在运行npm run dev时会报错:Cannot find module 'color-name',强行npm install color-name之后会提示:Invalid Version,请问作者是怎么解决的呢? #70

Closed H-Mon closed 7 months ago

H-Mon commented 7 months ago

在运行npm run dev时会报错:Cannot find module 'color-name',强行npm install color-name之后会提示:Invalid Version,请问是怎么解决的呢?

image image
jamebal commented 7 months ago
npm install vue-color
H-Mon commented 7 months ago

@jamebal 感谢回复,最终通过更改package.json里的engines,然后重新install,解决了问题。

image
H-Mon commented 7 months ago

直接拉下来运行遇到了很多node-module的版本冲突和报错, 调整了一下午,终于在本地把前端的工程跑起来了:

image

分享一下我的修改后的package.json(node使用16.20.2版本):

image
{
  "name": "jmal-cloud-view",
  "version": "2.7.0",
  "description": "jmalcloud",
  "author": "Jmal <zhushilun084@163.com>",
  "license": "MIT",
  "scripts": {
    "dev": "vue-cli-service serve",
    "build:prod": "vue-cli-service build",
    "build:stage": "vue-cli-service build --mode staging",
    "preview": "node build/index.js --preview",
    "lint": "eslint --ext .js,.vue src",
    "test:unit": "jest --clearCache && vue-cli-service test:unit",
    "test:ci": "npm run lint && npm run test:unit",
    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
  },
  "dependencies": {
    "ant-design-vue": "1.7.8",
    "artplayer": "^5.1.1",
    "clipboard": "^2.0.11",
    "cropperjs": "^1.6.1",
    "e-vue-contextmenu": "^0.1.3",
    "flv.js": "^1.6.2",
    "gsap": "^3.12.5",
    "highlightjs-line-numbers.js": "^2.8.0",
    "hls.js": "^1.5.7",
    "htmlhint": "^1.1.4",
    "jquery": "^3.7.1",
    "jquery-contextmenu": "^2.9.2",
    "jquery.fancytree": "^2.38.3",
    "js-cookie": "3.0.5",
    "jshint": "^2.13.6",
    "jspdf": "^2.5.1",
    "less-loader": "6.2.0",
    "lib-flexible": "^0.3.2",
    "moment": "^2.30.1",
    "monaco-editor": "^0.23.0",
    "monaco-editor-vue": "^1.0.10",
    "monaco-editor-webpack-plugin": "^3.0.1",
    "monaco-languages": "^2.3.0",
    "normalize.css": "7.0.0",
    "nprogress": "0.2.0",
    "path-to-regexp": "2.4.0",
    "pinyin": "^2.9.1",
    "qrcode": "^1.5.3",
    "scriptjs": "^2.5.9",
    "sockjs-client": "1.6.1",
    "sortablejs": "^1.15.2",
    "spark-md5": "^3.0.2",
    "stompjs": "^2.3.3",
    "v-contextmenu": "2.9.2",
    "v-viewer": "1.7.4",
    "vditor": "3.10.2",
    "vue-aplayer": "^1.6.1",
    "vue-color": "^2.8.1",
    "vue-runtime-helpers": "^1.1.2",
    "vue-simple-uploader": "0.7.6",
    "vuedraggable": "2.24.3",
    "vuex": "3.6.2"
  },
  "devDependencies": {
    "webpack": "4.47.0",
    "@babel/core": "7.24.3",
    "@babel/register": "7.23.7",
    "@vue/cli-plugin-babel": "4.5.19",
    "@vue/cli-plugin-eslint": "4.5.19",
    "@vue/cli-plugin-unit-jest": "4.5.19",
    "@vue/cli-service": "4.5.19",
    "@vue/test-utils": "2.4.5",
    "autoprefixer": "^9.5.1",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "10.1.0",
    "babel-jest": "29.7.0",
    "babel-plugin-import": "^1.13.8",
    "chalk": "5.3.0",
    "connect": "3.7.0",
    "eslint": "^5.15.3",
    "html-webpack-plugin": "3.2.0",
    "runjs": "^4.4.1",
    "sass": "1.52.1",
    "sass-loader": "7.3.1",
    "script-ext-html-webpack-plugin": "2.1.5",
    "script-loader": "0.7.2",
    "serve-static": "^1.15.0",
    "svg-sprite-loader": "6.0.11",
    "svgo": "3.2.0",
    "vue-kityminder-ggg": "^1.3.25",
    "vue-template-compiler": "^2.7.16"
  },
  "engines": {
    "node": "v16.20.2",
    "npm": "8.19.4"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}

最终启动起来的效果:

image