我正在尝试运行一个使用valet在mac上开发的laravel-vue应用程序。当我在本地主机上导入项目时,Npm run dev无法编译我的资产并显示以下错误
ERROR Failed to compile with 1 errors 10:08:55 AM
error in ./resources/js/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in C:\xampp\htdocs\tapper\node_modules\@babel\helper-compilation-targets\package.json
at applyExports (internal/modules/cjs/loader.js:491:9)
at resolveExports (internal/modules/cjs/loader.js:507:23)
at Function.Module._findPath (internal/modules/cjs/loader.js:635:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object.<anonymous> (C:\xampp\htdocs\tapper\node_modules\@babel\preset-env\lib\debug.js:8:33)
at Module._compile (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object.<anonymous> (C:\xampp\htdocs\tapper\node_modules\@babel\preset-env\lib\index.js:11:14)
at Module._compile (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at requireModule (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\files\plugins.js:165:12)
at loadPreset (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\files\plugins.js:83:17)
at createDescriptor (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:154:9)
at C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:109:50
at Array.map (<anonymous>)
at createDescriptors (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
at createPresetDescriptors (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
at C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:58:104
at cachedFunction (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\caching.js:62:27)
at cachedFunction.next (<anonymous>)
at evaluateSync (C:\xampp\htdocs\tapper\node_modules\gensync\index.js:244:28)
at sync (C:\xampp\htdocs\tapper\node_modules\gensync\index.js:84:14)
at presets (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:29:84)
at mergeChainOpts (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-chain.js:320:26)
at C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-chain.js:283:7
@ multi ./resources/js/app.js ./resources/sass/app.scss
Asset Size Chunks Chunk Names
/css/app.css 196 KiB /js/app [emitted] /js/app
/js/app.js 7.89 KiB /js/app [emitted] /js/app
ERROR in ./resources/js/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in C:\xampp\htdocs\tapper\node_modules\@babel\helper-compilation-targets\package.json
at applyExports (internal/modules/cjs/loader.js:491:9)
at resolveExports (internal/modules/cjs/loader.js:507:23)
at Function.Module._findPath (internal/modules/cjs/loader.js:635:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object.<anonymous> (C:\xampp\htdocs\tapper\node_modules\@babel\preset-env\lib\debug.js:8:33)
at Module._compile (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object.<anonymous> (C:\xampp\htdocs\tapper\node_modules\@babel\preset-env\lib\index.js:11:14)
at Module._compile (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (C:\xampp\htdocs\tapper\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at requireModule (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\files\plugins.js:165:12)
at createDescriptors (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
at createPresetDescriptors (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
at C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:58:104
at cachedFunction (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\caching.js:62:27)
at cachedFunction.next (<anonymous>)
at evaluateSync (C:\xampp\htdocs\tapper\node_modules\gensync\index.js:244:28)
at sync (C:\xampp\htdocs\tapper\node_modules\gensync\index.js:84:14)
at presets (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-descriptors.js:29:84)
at mergeChainOpts (C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-chain.js:320:26)
at C:\xampp\htdocs\tapper\node_modules\@babel\core\lib\config\config-chain.js:283:7
@ multi ./resources/js/app.js ./resources/sass/app.scss /js/app[0]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\tunne\AppData\Roaming\npm-cache\_logs\2020-07-13T07_08_55_699Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\tunne\AppData\Roaming\npm-cache\_logs\2020-07-13T07_08_55_779Z-debug.log
我的问题是,由于该应用程序是在Mac上开发的,并且我们试图在locahost上的Windows + xampp上运行它,因此环境配置可能会成为问题吗?如果是这样,我该如何解决? 让我补充说,该应用程序在登台站点(laravel forge)上运行得很好,因此我认为代码中没有任何错误。 甚至作曲家的安装和作曲家更新也会失败,并显示“您的要求无法解决为一组可安装的软件包”。有人可以告诉我问题是什么