bug:The following dependencies are imported but could not be resolved lib-flexibleflexible

简介: bug:The following dependencies are imported but could not be resolved lib-flexibleflexible
ivyone@ivyonedeMacBook-Pro daily-cost % npm run dev
> vite-project@0.0.0 dev /Users/ivyone/hami94/daily-cost
> vite
 > src/router/index.js:3:17: error: Could not resolve "../views/Data.vue"
    3 │ import Data from "../views/Data.vue";
      ?                  ~~~~~~~~~~~~~~~~~~~
error when starting dev server:
Error: Build failed with 1 error:
src/router/index.js:3:17: error: Could not resolve "../views/Data.vue"
    at failureErrorWithLog (/Users/ivyone/hami94/daily-cost/node_modules/esbuild/lib/main.js:1160:15)
    at buildResponseToResult (/Users/ivyone/hami94/daily-cost/node_modules/esbuild/lib/main.js:896:32)
    at /Users/ivyone/hami94/daily-cost/node_modules/esbuild/lib/main.js:991:20
    at /Users/ivyone/hami94/daily-cost/node_modules/esbuild/lib/main.js:542:9
    at handleIncomingPacket (/Users/ivyone/hami94/daily-cost/node_modules/esbuild/lib/main.js:631:9)
    at Socket.readFromStdout (/Users/ivyone/hami94/daily-cost/node_modules/esbuild/lib/main.js:509:7)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vite-project@0.0.0 dev: `vite`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vite-project@0.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ivyone/.npm/_logs/2021-03-12T00_05_38_519Z-debug.log
ivyone@ivyonedeMacBook-Pro daily-cost % npm run dev
> vite-project@0.0.0 dev /Users/ivyone/hami94/daily-cost
> vite
error when starting dev server:
Error: The following dependencies are imported but could not be resolved:
  lib-flexible/flexible (imported by /Users/ivyone/hami94/daily-cost/src/main.js)
Are they installed?
    at optimizeDeps (/Users/ivyone/hami94/daily-cost/node_modules/vite/dist/node/chunks/dep-e0f09032.js:67754:15)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async runOptimize (/Users/ivyone/hami94/daily-cost/node_modules/vite/dist/node/chunks/dep-e0f09032.js:68328:48)
    at async Server.httpServer.listen (/Users/ivyone/hami94/daily-cost/node_modules/vite/dist/node/chunks/dep-e0f09032.js:68342:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vite-project@0.0.0 dev: `vite`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vite-project@0.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ivyone/.npm/_logs/2021-03-12T00_06_46_494Z-debug.log
ivyone@ivyonedeMacBook-Pro daily-cost % npm install lib-flexible --save-dev
npm notice save lib-flexible is being moved from dependencies to devDependencies
npm WARN less-loader@8.0.0 requires a peer of webpack@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN vite-project@0.0.0 No description
npm WARN vite-project@0.0.0 No repository field.
npm WARN vite-project@0.0.0 No license field.
+ lib-flexible@0.3.2
added 1 package in 2.762s
5 packages are looking for funding
  run `npm fund` for details
ivyone@ivyonedeMacBook-Pro daily-cost % npm run dev
> vite-project@0.0.0 dev /Users/ivyone/hami94/daily-cost
> vite
Pre-bundling dependencies:
  vue
  lib-flexible/flexible
  vant
  vue-router
(this will be run only when your dependencies or config have changed)
  vite v2.0.5 dev server running at:
  > Local:    http://localhost:3000/
  > Network:  http://192.168.3.11:3000/
  ready in 981ms.

解决方法:

安装lib-flexible

npm install lib-flexible --save-dev
相关文章
|
3月前
|
JavaScript 编译器
成功解决:Module build failed: Error: Vue packages version mismatch
这篇文章记录了解决Vue项目中遇到的"Module build failed: Error: Vue packages version mismatch"错误的步骤,原因是项目中Vue依赖的版本不一致,解决方法是删除`node_modules`后重新安装指定版本的Vue和`vue-template-compiler`,确保版本匹配,最终成功运行项目。
成功解决:Module build failed: Error: Vue packages version mismatch
|
Java Maven
Maven错误:was cached in the local repository, resolution will not be reattempted until the update
Maven错误:was cached in the local repository, resolution will not be reattempted until the update
381 1
|
11月前
Error: Plugin/Preset files are not allowed to export objects, only functions……
Error: Plugin/Preset files are not allowed to export objects, only functions……
|
Java Maven
Error running ‘ssm [clean]‘: No valid Maven installation found. Either set the home directory in the
Error running ‘ssm [clean]‘: No valid Maven installation found. Either set the home directory in the
123 0
|
Java Scala
sbt.internal.inc.CompileFailed: Error compiling the sbt component ‘compiler-interface-2.11.8-61.0‘
IDEA 的 JDK 和 Scala 版本对应不上。 使用 Scala12.1.8配上 JDK8
483 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
698 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
|
iOS开发
编译OpenJDK8报错:configure: error: Failed to determine Xcode version.
编译OpenJDK8报错:configure: error: Failed to determine Xcode version.
112 0
configure: error: C compiler cannot create executables
configure: error: C compiler cannot create executables
321 0
mvn Failed during checkstyle execution: There are errors reported by Checkstyle 6.2
mvn Failed during checkstyle execution: There are errors reported by Checkstyle 6.2
143 0
编译x264出现错误:No working C compiler found.
编译x264出现错误:No working C compiler found.
337 0