升级到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.
在升级Vue3后遇到npmrunserve报错,提示缺少typescript模块。解决方案是通过运行npminstalltypescript--save-dev安装typescript作为开发依赖。如果问题依然存在,可以删除node_modules目录并重新安装所有依赖:rm-rfnode_modules,然后执行npminstall。
1044

被折叠的 条评论
为什么被折叠?



