ant-design / antd-tools

🔧 Cli Tools for Ant Design React
https://ant.design/
399 stars 149 forks source link

Error locating tsconfig.json #113

Open jmiller-cvet opened 5 years ago

jmiller-cvet commented 5 years ago

I am creating a component library following the same structure as the Ant Design library and want to use antd-tools in the same way as part of my build process. However, when I execute "npm run compile", I get the following error:

Error: Cannot find module 'C:\projects\component-library\node_modules\C:\projects\component-library\tsconfig.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at Module.require (C:\Source\cvet\evolution-ui-components\node_modules\antd-tools\lib\utils\projectHelper.js:32:25)
    at require (internal/modules/cjs/helpers.js:22:18)
    at module.exports (C:\Source\cvet\evolution-ui-components\node_modules\antd-tools\lib\getTSCommonConfig.js:10:10)
    at Object.<anonymous> (C:\Source\cvet\evolution-ui-components\node_modules\antd-tools\lib\gulpfile.js:28:48)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

The path 'C:\projects\component-library\tsconfig.json' is correct. Any idea what I need to do so the require statement looks for the file in the correct location?

I've forked Ant Design and the same statement works fine and I do not see what is different in our configuration.

YYL1999 commented 1 year ago

你解决了嘛 我也遇到了