lundi 13 juillet 2020

Npm run dev fails on my laravel vue project

I am trying to run a laravel-vue application that was developed on mac using valet . When i imported the project on localhost, Npm run dev fails to compile my assets and shows the following error

 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

My question is, since the application was developed on mac and we are trying to run it on windows +xampp on locahost, could the environment configuration be the issue? if so, how do i solve it? Let me add that the application runs perfectly fine on the staging site (laravel forge) so i donot think there is any error in the code. Even composer install and composer update fail with "Your requirements could not be resolved to an installable set of packages". Can someone please tell me what the issue is



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire