升级到vue3最新版之后,npm run serve 出现标题错误,谷歌了半天,没找到解决方案,openai一下。解决了。其实就npm install typescript --save-dev
这行就搞定了
This error message typically indicates that the required module “typescript” is not installed in your project. To fix this error, you can try the following steps:
- Make sure that you have Node.js and npm installed on your system.
- Open the terminal or command prompt and navigate to your project directory.
- Run the following command to install TypeScript as a local dependency:
npm install typescript --save-dev
- Once the installation is complete, try running your project again.
If you still encounter the same error, you can try deleting the “node_modules” directory and reinstalling all dependencies by running the following commands:
rm -rf node_modules
npm install
This will remove the existing “node_modules” directory and reinstall all dependencies, including TypeScript.
If you’re using a package manager other than npm (such as Yarn), the commands may differ slightly, so be sure to consult your package manager’s documentation for the correct installation steps.