Error: Cannot find module '<projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/typescript-vue-tsc/package.json'
See original GitHub issueDescribe the bug
When enabling vueTsc
inside vite.config.ts by setting vueTsc: true
, this error appears when running vite
in dev-mode.
It appears, that a package.json
is missing inside node_modules/vite-plugin-checker/lib/checkers/vueTsc/typescript-vue-tsc/
The issue was fixed by downgrading to v0.4.3
Reproduction
- Install
vite-plugin-checker
withpnpm
- set
vueTsc: true
insidevite.config.js
- run
vite
Expected behavior
It should run without error.
System Info
System:
OS: macOS 12.3
CPU: (8) arm64 Apple M1
Memory: 166.08 MB / 16.00 GB
Shell: 5.8.1 - /opt/homebrew/bin/zsh
Binaries:
Node: 16.14.0 - /usr/local/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Browsers:
Chrome: 99.0.4844.84
Safari: 15.4
npmPackages:
vite-plugin-checker: 0.4.4 => 0.4.4
Additional context
node:internal/event_target:916
process.nextTick(() => { throw err; });
^
Error: Cannot find module '<projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/typescript-vue-tsc/package.json'
Require stack:
- <projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/prepareVueTsc.js
- <projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/main.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at prepareVueTsc (<projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/prepareVueTsc.js:44:33)
at Object.configureServer (<projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/main.js:27:71)
at MessagePort.<anonymous> (<projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/worker.js:56:36)
at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28)
Emitted 'error' event on Worker instance at:
at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
at Worker.[kOnMessage] (node:internal/worker:300:37)
at MessagePort.<anonymous> (node:internal/worker:201:57)
at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28)
at Worker.[kOnExit] (node:internal/worker:267:5)
at Worker.<computed>.onexit (node:internal/worker:198:20) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'<projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/prepareVueTsc.js',
'<projectDir>/node_modules/.pnpm/vite-plugin-checker@0.4.4_vite@2.8.6/node_modules/vite-plugin-checker/lib/checkers/vueTsc/main.js'
]
}
Validations
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:22 (5 by maintainers)
Top Results From Across the Web
Cannot find module 'node:path' in vite.config.ts · Issue #9113 ...
The error is Error: Cannot find module 'node:path' which seems to mean that the build isn't running in a node environment.
Read more >Troubleshooting - Vite
Error : Cannot find module 'C:\foo\bar&baz\vite\bin\vite.js' #. The path to your project folder may include & , which doesn't work with npm on...
Read more >cannot find module 'vite' or its corresponding type declarations
To solve the "Cannot find module `path` or its corresponding type declarations" error, install the types for node by running the command `npm...
Read more >package.json issue while deploying a node api on Azure App ...
The Github Actions part works fine, but the website doesn't work, and when I look in the logs, it shows this error :...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
version: vite-plugin-checker@0.5.1 yarn v1.22.19 vite v3
When I install a new package, the folder of
dist/cjs/checkers/vueTsc/typescript-vue-tsc
will be removed automatically (the same asdist/esm/...
), and then dev error.And, retry to run
start
, the folder will be created again.I tried to find the reason but couldn’t find it.
Error logs:
@fi3ework
hello,Has this problem been solved