【问题标题】:How do I fix the error "Error: no valid exports main found" on windows 7如何修复 Windows 7 上的错误“错误:找不到有效的导出主程序”
【发布时间】:2021-03-21 19:06:30
【问题描述】:

我无法在我的 Windows 7 操作系统上运行 react 应用程序。我安装了 npm 版本 6.13.4,节点版本 13.6.0。当我执行 npm start 时,它给了我以下错误代码。我尝试删除节点模块并再次执行 npm install 并尝试运行,但仍然出错。知道如何解决这个问题吗?

Error: No valid exports main found for 'D:\practice\samplereact\test\node_modules\postcss-safe-parser\node_modules\postcss'
←[90m    at resolveExportsTarget (internal/modules/cjs/loader.js:625:9)←[39m
←[90m    at applyExports (internal/modules/cjs/loader.js:502:14)←[39m
←[90m    at resolveExports (internal/modules/cjs/loader.js:551:12)←[39m
←[90m    at Function.Module._findPath (internal/modules/cjs/loader.js:657:22)←[39m
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:855:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:1033:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:72:18)←[39m
    at Object.<anonymous> 
(D:\practice\samplereact\test\node_modules\←[4mpostcss-safe-parser←[24m\lib\safe-parse.js:1:17)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1144:30)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m

我正在尝试通过 VS 代码运行 React 应用程序

【问题讨论】:

    标签: javascript reactjs npm visual-studio-code package.json


    【解决方案1】:

    请运行npm i --save,如果它仍然无法运行,请将您的package.json 文件添加到您的问题中。

    【讨论】:

    • 我试过 npm i --save 但它仍然给出错误
    • 将您的 package.json 文件添加到您的问题中。
    猜你喜欢
    • 2020-10-28
    • 1970-01-01
    • 1970-01-01
    • 2019-10-23
    • 1970-01-01
    • 2015-01-25
    • 2015-05-11
    • 2017-10-08
    • 1970-01-01
    相关资源
    最近更新 更多