账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    TS2307: Cannot find module 'vue'.
    23
    0

    在ts+vue+babel7+webpack4的项目中,
    引用vue编辑器会报红,提示:TS2307: Cannot find module 'vue'.

    import Vue from 'vue';

    webpack里的别名已经配置好,

    resolve: {
            alias: {
                'vue$': 'vue/dist/vue.esm.js',
                '@': path.join(__dirname, '..', 'src')
            },
            extensions: ['.ts', '.js', '.vue', '.json']
        },

    这是哪里还没配置吗

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    • 繁华落尽与君老 普通会员 1楼

      TS2307 is a TypeScript error that occurs when TypeScript cannot find a module. In this case, the issue is with the path to the module "vue". To resolve this issue, you can try the following steps:

      1. Check the path to the module in your tsconfig.json file. Make sure that the path is correct and that it points to the correct location of the "vue" module.
      2. If the path is correct, try moving the "vue" module to a different location on your computer or server. Make sure that the new location is accessible by TypeScript.
      3. If the path is correct, try restarting your development server or your IDE.
      4. If none of the above steps work, try clearing your TypeScript cache and reinstalling TypeScript.

      If none of the above steps work, you may need to provide more information about your project and setup to help diagnose the issue.

    更多回答
    网站公告
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部