Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配置jsconfig后提示报错👉找不到文件“/Users/huang/Desktop/taro-test/taro-yanxuan/node_modules/mobile-detect/mobile-detect”。 #37

Open
AnathanPham opened this issue Jul 8, 2019 · 3 comments

Comments

@AnathanPham
Copy link

AnathanPham commented Jul 8, 2019

概述

我按照README.md的指示成功运行项目。
因为该项目使用了别名,但是没有添加jsconfig.json文件。
所以我就自己在项目中添加了jsconfig.json文件。
结果虽然别名引用跳转能够正常工作,但是在 vscode 下方面板的问题选项卡中显示

找不到文件“/Users/huang/Desktop/taro-test/taro-yanxuan/node_modules/mobile-detect/mobile-detect”。

详细

目录结构

我只添加了jsconfig.json文件
image

jsconfig.json代码

{
  "exclude": ["node_modules/"],
  "target": "es6",
  "checkJs": true,
  "allowSyntheticDefaultImports": true,
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@actions/*": ["./src/actions/*"],
      "@assets/*": ["./src/assets/*"],
      "@components/*": ["./src/components/*"],
      "@constants/*": ["./src/constants/*"],
      "@reducers/*": ["./src/reducers/*"],
      "@styles/*": ["./src/styles/*"],
      "@utils/*": ["./src/utils/*"]
    }
  }
}

VS code 提示错误消息提示

{
"resource": "/Users/huang/Desktop/taro-test/taro-yanxuan/jsconfig.json",
"owner": "typescript",
"severity": 8,
"message": "找不到文件“/Users/huang/Desktop/taro-test/taro-yanxuan/node_modules/mobile-detect/mobile-detect”。",
"source": "ts",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 2
}

@wsz7777
Copy link

wsz7777 commented Jul 15, 2019

屏幕快照 2019-07-15 12 14 35

我也同样遇到了这个问题

屏幕快照 2019-07-15 12 16 54

@YoursOwen
Copy link

same question...

@okkjoo
Copy link

okkjoo commented Feb 15, 2022

image
这样可以解决这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants