vue3+ts启动项目报错,实在是解决不了,求大家看看

[ERROR] Failed to resolve entry for package “@intlify/shared“. The package may have incorrect main/module/exports specified in its package.json: No known conditions for “.” specifier in “@intlify/sharedpackage [plugin vite:depprebundle]
                                                                                                                                                                                                                                                  
    node_modules/esbuild/lib/main.js:1360:21:                                                                                                                                                                                                     
      1360 │         let result = await callback({                                                                                                                                                                                                
           ╵                      ^                                                                                                                                                                                                               
                                                                                                                                                                                                                                                  
    at packageEntryFailure (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23367:11)                                                                                                                                  
    at resolvePackageEntry (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23362:9)                                                                                                                                   
    at tryNodeResolve (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23104:20)                                                                                                                                       
    at Context.resolveId (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:22865:28)                                                                                                                                    
    at Object.resolveId (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:42793:46)                                                                                                                                     
    at processTicksAndRejections (node:internal/process/task_queues:96:5)                                                                                                                                                                         
    at async file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:64084:21                                                                                                                                                  
    at async file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23680:34
    at async requestCallbacks.onresolve (E:yph_web_plusnode_modulesesbuildlibmain.js:1360:22)
    at async handleRequest (E:yph_web_plusnode_modulesesbuildlibmain.js:723:13)

  This error came from theonResolve” callback registered here:

    node_modules/esbuild/lib/main.js:1279:20:
      1279 │       let promise = setup({
           ╵                     ^

    at setup (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23660:19)
    at handlePlugins (E:yph_web_plusnode_modulesesbuildlibmain.js:1279:21)
    at buildOrContextImpl (E:yph_web_plusnode_modulesesbuildlibmain.js:968:5)
    at Object.buildOrContext (E:yph_web_plusnode_modulesesbuildlibmain.js:776:5)
    at E:yph_web_plusnode_modulesesbuildlibmain.js:2172:68
    at new Promise (<anonymous&gt;)
    at Object.context (E:yph_web_plusnode_modulesesbuildlibmain.js:2172:27)
    at Object.context (E:yph_web_plusnode_modulesesbuildlibmain.js:2012:58)
    at prepareEsbuildOptimizerRun (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:44389:35)

  The plugin “vite:dep-prebundlewas triggered by this import

    node_modules/vue-i18n/dist/vue-i18n.cjs:8:21:
      8 │ var shared = require(‘@intlify/shared‘);
        ╵                      ~~~~~~~~~~~~~~~~~

E:yph_web_plusnode_modulesesbuildlibmain.js:1636
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
node_modules/esbuild/lib/main.js:1360:21: ERROR: [plugin: vite:dep-prebundle] Failed to resolve entry for package “@intlify/shared“. The package may have incorrect main/module/exports specified in its package.json: No known conditions for “.” spec
ifier in “@intlify/sharedpackage
    at failureErrorWithLog (E:yph_web_plusnode_modulesesbuildlibmain.js:1636:15)
    at E:yph_web_plusnode_modulesesbuildlibmain.js:1048:25
    at E:yph_web_plusnode_modulesesbuildlibmain.js:1512:9
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  errors: [
    {
      detail: Error: Failed to resolve entry for package “@intlify/shared“. The package may have incorrect main/module/exports specified in its package.json: No known conditions for “.” specifier in “@intlify/shared” package
          at packageEntryFailure (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23367:11)
          at resolvePackageEntry (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23362:9)
          at tryNodeResolve (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23104:20)
          at Context.resolveId (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:22865:28)
          at Object.resolveId (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:42793:46)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at async file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:64084:21
          at async file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23680:34
          at async requestCallbacks.on-resolve (E:yph_web_plusnode_modulesesbuildlibmain.js:1360:22)
          at async handleRequest (E:yph_web_plusnode_modulesesbuildlibmain.js:723:13),
      id: ”,
      location: {
        column: 21,
        file: ‘node_modules/esbuild/lib/main.js’,
        length: 0,
        line: 1360,
        lineText: ‘        let result = await callback({n’ +
          ‘    at packageEntryFailure (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23367:11)n’ +
          ‘    at resolvePackageEntry (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23362:9)n’ +
          ‘    at tryNodeResolve (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23104:20)n’ +
          ‘    at Context.resolveId (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:22865:28)n’ +
          ‘    at Object.resolveId (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:42793:46)n’ +
          ‘    at processTicksAndRejections (node:internal/process/task_queues:96:5)n’ +
          ‘    at async file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:64084:21n’ +
          ‘    at async file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23680:34n’ +
          ‘    at async requestCallbacks.on-resolve (E:\yph_web_plus\node_modules\esbuild\lib\main.js:1360:22)n’ +
          ‘    at async handleRequest (E:\yph_web_plus\node_modules\esbuild\lib\main.js:723:13)’,
        namespace: ‘file’,
        suggestion: ”
      },
      notes: [
        {
          location: {
            length: 0,
            line: 1279,
            lineText: ‘      let promise = setup({n’ +
              ‘    at setup (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:23660:19)n’ +
              ‘    at handlePlugins (E:\yph_web_plus\node_modules\esbuild\lib\main.js:1279:21)n’ +
              ‘    at buildOrContextImpl (E:\yph_web_plus\node_modules\esbuild\lib\main.js:968:5)n’ +
              ‘    at Object.buildOrContext (E:\yph_web_plus\node_modules\esbuild\lib\main.js:776:5)n’ +
              ‘    at E:\yph_web_plus\node_modules\esbuild\lib\main.js:2172:68n’ +
              ‘    at new Promise (<anonymous>)n’ +
              ‘    at Object.context (E:\yph_web_plus\node_modules\esbuild\lib\main.js:2172:27)n’ +
              ‘    at Object.context (E:\yph_web_plus\node_modules\esbuild\lib\main.js:2012:58)n’ +
              ‘    at prepareEsbuildOptimizerRun (file:///E:/yph_web_plus/node_modules/vite/dist/node/chunks/dep-24daf00c.js:44389:35)’,
            namespace: ‘file’,
            suggestion: ”
          },
          text: ‘This error came from the “onResolve” callback registered here:’
        },
        {
          location: {
            column: 21,
            file: ‘node_modules/vue-i18n/dist/vue-i18n.cjs’,
            length: 17,
            line: 8,
            lineText: “var shared = require(‘@intlify/shared‘);”,
            namespace: ”,
            suggestion: ”
          },
          text: ‘The plugin “vite:dep-pre-bundle” was triggered by this import
        }
      ],
      pluginName: ‘vite:dep-pre-bundle’,
      text: ‘Failed to resolve entry for package “@intlify/shared“. The package may have incorrect main/module/exports specified in its package.json: No known conditions for “.” specifier in “@intlify/shared” package’
    }
  ],
  warnings: []
 

原文地址:https://blog.csdn.net/nan0625/article/details/132757395

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_33458.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注