7:46:30 PM [vite] Internal server error: Preprocessor dependency "less" not found. Did you install it?
Plugin: vite:css
File: /home/vagrant/jscode/pear-admin-ant/node_modules/ant-design-vue/dist/antd.less
at loadPreprocessor (/home/vagrant/jscode/pear-admin-ant/node_modules/vite/dist/node/chunks/dep-874085d4.js:34385:15)
at less (/home/vagrant/jscode/pear-admin-ant/node_modules/vite/dist/node/chunks/dep-874085d4.js:34483:22)
at compileCSS (/home/vagrant/jscode/pear-admin-ant/node_modules/vite/dist/node/chunks/dep-874085d4.js:34127:40)
at async TransformContext.transform (/home/vagrant/jscode/pear-admin-ant/node_modules/vite/dist/node/chunks/dep-874085d4.js:33776:50)
at async Object.transform (/home/vagrant/jscode/pear-admin-ant/node_modules/vite/dist/node/chunks/dep-874085d4.js:50353:30)
at async transformRequest (/home/vagrant/jscode/pear-admin-ant/node_modules/vite/dist/node/chunks/dep-874085d4.js:65394:29)
at async viteTransformMiddleware (/home/vagrant/jscode/pear-admin-ant/node_modules/vite/dist/node/chunks/dep-874085d4.js:65522:32)
node: v16.9.0
配置信息
"dependencies": {
"@ant-design-vue/use": "^0.0.1-alpha.10",
"@ant-design/icons-vue": "^6.0.1",
"@antv/g2": "^4.1.20",
"@vitejs/plugin-vue": "^1.6.2",
"ant-design-vue": "^2.2.8",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"lodash.get": "^4.4.2",
"moment": "^2.27.0",
"nprogress": "^0.2.0",
"path": "^0.12.7",
"rollup-plugin-visualizer": "^5.5.2",
"vue": "^3.2.21",
"vue-i18n": "^9.1.7",
"vue-router": "^4.0.10",
"vuex": "^4.0.2"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@types/node": "^14.17.9",
"@vue/compiler-sfc": "^3.2.21",
"@zougt/vite-plugin-theme-preprocessor": "^1.3.12",
"babel-plugin-import": "^1.13.3",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^7.18.0",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"mockjs2": "^1.0.8",
"node-sass": "^6.0.0",
"rollup-plugin-analyzer": "^4.0.0",
"sass-loader": "^10.0.2",
"vite": "^2.5.8"
},
尝试的方案
npm install less less-loader
和 npm install less less-loader -D
都没有效果, 删除 node_modules, 在运行这些命令也一样
替换 registry, 在运行 1 的命令也没有效果
vagrant@ubuntu:~/jscode/pear-admin-ant$ npm get registry
http://registry.npmmirror.com/
所以到底怎么搞呢兄弟们?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.