Parsing error: Cannot find module ‘typescript‘

在升级Vue3后遇到npmrunserve报错,提示缺少typescript模块。解决方案是通过运行npminstalltypescript--save-dev安装typescript作为开发依赖。如果问题依然存在,可以删除node_modules目录并重新安装所有依赖:rm-rfnode_modules,然后执行npminstall。
摘要由CSDN通过智能技术生成

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值