события.js:182 выбрасывает er; // Необработанное событие «ошибка» и не может прочитать свойство «имеет» неопределенное

#reactjs #npm #babeljs #node-modules #stenciljs

Вопрос:

Я потерял свои исходные node_modules (из-за очистки диска), и мне пришлось снова загружать файлы тем и node_modules.

Я предполагаю, что эта ошибка появится в новой версии @babel 7, но я перепробовал почти все, и это все еще не работает.

Ошибки:

 ERROR in ./assets/js/theme/account.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemeaccount.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/cart.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemecart.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/common/collapsible.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemecommoncollapsible.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/common/faceted-search.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemecommonfaceted-search.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/common/form-utils.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemecommonform-utils.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/common/nod-functions/min-max-validate.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemecommonnod-functionsmin-max-validate.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/common/product-details.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemecommonproduct-details.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/common/state-country.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemecommonstate-country.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/global/compare-products.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemeglobalcompare-products.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/global/mobile-menu-toggle.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemeglobalmobile-menu-toggle.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28

ERROR in ./assets/js/theme/global/quick-search.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: F:[09] backupszebreoassetsjsthemeglobalquick-search.js: Cannot read property 'has' of undefined
    at resolvePath (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:22:24)
    at importModule (F:[09] backupszebreonode_modulesbabel-plugin-lodashlibimportModule.js:36:53)
    at memoized (F:[09] backupszebreonode_moduleslodashmemoize.js:62:23)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:217:63
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:193:30
    at arrayEach (F:[09] backupszebreonode_moduleslodash_arrayEach.js:15:9)
    at forEach (F:[09] backupszebreonode_moduleslodashforEach.js:38:10)
    at F:[09] backupszebreonode_modulesbabel-plugin-lodashlibindex.js:181:28
    
    events.js:173
          throw er; // Unhandled 'error' event
          ^
    
    TypeError: Expected pattern to be a non-empty string
        at picomatch (C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_modulespicomatchlibpicomatch.js:48:11)
        at createPattern (C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_modulesanymatchindex.js:27:18)
        at C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_modulesanymatchindex.js:91:21
        at Array.map (<anonymous>)
        at anymatch (C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_modulesanymatchindex.js:91:6)
        at C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_moduleschokidarindex.js:272:51
        at Array.every (<anonymous>)
        at C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_moduleschokidarindex.js:270:22
        at Array.some (<anonymous>)
        at WatchHelper.filterDir (C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_moduleschokidarindex.js:269:43)
    Emitted 'error' event at:
        at FSWatcher._handleError (C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_moduleschokidarindex.js:647:10)
        at ReaddirpStream.NodeFsHandler._boundHandleError (C:ProgramDatanvmv12.0.0node_modules@bigcommercestencil-clinode_moduleschokidarlibnodefs-handler.js:303:43)
        at ReaddirpStream.emit (events.js:196:13)
        at emitErrorNT (internal/streams/destroy.js:91:8)
        at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
        at processTicksAndRejections (internal/process/task_queues.js:83:17)
 

Что я пытался:

Прежде всего, я убедился, что я повышен до

 babel-preset-env
 

и добавил его в качестве зависимостей от разработчиков

package.json: https://i.stack.imgur.com/CZ8GI.png

не решил проблему.

Затем я удалил

 node_modules
 

удалил

 package-lock.json
 

очистил кэш

 npm cache clear --force
 

и переустановил модули

 npm install
 

Все еще не работает и выдает ту же ошибку.

Может быть, у вас есть идея, что еще я могу здесь попробовать?

Спасибо!

Ответ №1:

Хорошо, я решил эту проблему, переместив свой каталог из

F:[09] резервные копииzebreo

Для

F:zebreo

похоже, что [] был причиной проблемы

Нашел решение здесь https://github.com/lodash/babel-plugin-lodash/issues/124#issuecomment-599450158