首页 前端知识 Parsing error: Cannot find module ‘typescript‘

Parsing error: Cannot find module ‘typescript‘

2024-06-08 22:06:07 前端知识 前端哥 453 940 我要收藏

升级到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:

  1. Make sure that you have Node.js and npm installed on your system.
  2. Open the terminal or command prompt and navigate to your project directory.
  3. Run the following command to install TypeScript as a local dependency:
npm install typescript --save-dev
  1. 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.

转载请注明出处或者链接地址:https://www.qianduange.cn//article/11531.html
标签
评论
发布的文章

小米商城

2024-06-16 15:06:28

JSON转日期,变为数字串

2024-06-16 09:06:45

使用axios读取本地json文件

2024-06-16 09:06:39

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!