Я работаю над Laravel 7.9.2, и когда я делаю npm install
, он устанавливает слишком много файлов, что отличается от обучающих программ на Youtube.
Вот файлы за пределами node_modules, с которыми я не знаком:
Изображение
Вот несколько папок внутри node_modules:
Изображение 1 | Изображение 2 (есть еще много)
И когда я запускаю npm run dev
, я получаю следующие ошибки:
> @ dev E:\Xampp\htdocs\practice
> npm run development
> @ development E:\Xampp\htdocs\practice
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
98% after emitting SizeLimitsPlugin
ERROR Failed to compile with 3 errors 4:13:46 PM
error in ./resources/js/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
BrowserslistError: [BABEL] E:\Xampp\htdocs\practice\resources\js\app.js: Unknown browser query `basedir=$(dirname "$(echo
"$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query. (While processing: "E:\\Xampp\\htdocs\\practice\\node_modules\\@babel\\preset-env\\lib\\index.js")
at unknownQuery (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:285:10)
at E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:372:11
at Array.reduce (<anonymous>)
at resolve (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:318:18)
at browserslist (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:443:21)
at getTargets (E:\Xampp\htdocs\practice\node_modules\@babel\helper-compilation-targets\lib\index.js:202:48)
at E:\Xampp\htdocs\practice\node_modules\@babel\preset-env\lib\index.js:246:57
at E:\Xampp\htdocs\practice\node_modules\@babel\helper-plugin-utils\lib\index.js:19:12
at E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:199:14
at Generator.next (<anonymous>)
at Function.<anonymous> (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\gensync-utils\async.js:26:3)
at Generator.next (<anonymous>)
at step (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:254:32)
at evaluateAsync (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:284:5)
at Function.errback (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:108:7)
at errback (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\gensync-utils\async.js:70:18)
at async (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:183:31)
at onFirstPause (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:209:13)
at Generator.next (<anonymous>)
at cachedFunction (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\caching.js:68:46)
at cachedFunction.next (<anonymous>)
at loadPresetDescriptor (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:292:44)
at loadPresetDescriptor.next (<anonymous>)
at recurseDescriptors (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:107:30)
at recurseDescriptors.next (<anonymous>)
at loadFullConfig (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:142:6)
at loadFullConfig.next (<anonymous>)
at Function.transform (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\transform.js:25:45)
at transform.next (<anonymous>)
at step (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:262:25)
at E:\Xampp\htdocs\practice\node_modules\gensync\index.js:266:13
at async.call.result.err.err (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:216:11)
at E:\Xampp\htdocs\practice\node_modules\gensync\index.js:184:28
at E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\gensync-utils\async.js:72:7
at E:\Xampp\htdocs\practice\node_modules\gensync\index.js:108:33
at step (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:280:14)
@ multi ./resources/js/app.js ./resources/sass/app.scss
error in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.
at unknownQuery (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:285:10)
at E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:372:11
at Array.reduce (<anonymous>)
at resolve (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:318:18)
at browserslist (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:443:21)
at Browsers.parse (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:64:12)
at new Browsers (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:46:26)
at loadPrefixes (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:97:20)
at plugin (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:108:20)
at LazyResult.run (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:295:14)
at LazyResult.asyncTick (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:208:26)
at E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:250:14
at new Promise (<anonymous>)
at LazyResult.async (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:246:23)
at LazyResult.then (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:127:17)
at E:\Xampp\htdocs\practice\node_modules\postcss-loader\src\index.js:142:8
at E:\Xampp\htdocs\practice\node_modules\webpack\lib\NormalModule.js:316:20
at E:\Xampp\htdocs\practice\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at E:\Xampp\htdocs\practice\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (E:\Xampp\htdocs\practice\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at E:\Xampp\htdocs\practice\node_modules\postcss-loader\src\index.js:208:9
error in ./resources/sass/app.scss
Module build failed (from ./node_modules/postcss-loader/src/index.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.
at unknownQuery (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:285:10)
at E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:372:11
at Array.reduce (<anonymous>)
at resolve (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:318:18)
at browserslist (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:443:21)
at Browsers.parse (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:64:12)
at new Browsers (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:46:26)
at loadPrefixes (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:97:20)
at plugin (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:108:20)
at LazyResult.run (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:295:14)
at LazyResult.asyncTick (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:208:26)
at E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:250:14
at new Promise (<anonymous>)
at LazyResult.async (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:246:23)
at LazyResult.then (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:127:17)
at E:\Xampp\htdocs\practice\node_modules\postcss-loader\src\index.js:142:8
@ ./resources/sass/app.scss 2:14-253
Asset Size Chunks Chunk Names
/js/app.js 9.97 KiB /js/app [emitted] /js/app
ERROR in ./resources/js/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
BrowserslistError: [BABEL] E:\Xampp\htdocs\practice\resources\js\app.js: Unknown browser query `basedir=$(dirname "$(echo
"$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query. (While processing: "E:\\Xampp\\htdocs\\practice\\node_modules\\@babel\\preset-env\\lib\\index.js")
at unknownQuery (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:285:10)
at E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:372:11
at Array.reduce (<anonymous>)
at resolve (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:318:18)
at browserslist (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:443:21)
at getTargets (E:\Xampp\htdocs\practice\node_modules\@babel\helper-compilation-targets\lib\index.js:202:48)
at E:\Xampp\htdocs\practice\node_modules\@babel\preset-env\lib\index.js:246:57
at E:\Xampp\htdocs\practice\node_modules\@babel\helper-plugin-utils\lib\index.js:19:12
at E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:199:14
at Generator.next (<anonymous>)
at Function.<anonymous> (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\gensync-utils\async.js:26:3)
at Generator.next (<anonymous>)
at step (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:254:32)
at evaluateAsync (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:284:5)
at Function.errback (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:108:7)
at errback (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\gensync-utils\async.js:70:18)
at async (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:183:31)
at onFirstPause (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:209:13)
at Generator.next (<anonymous>)
at cachedFunction (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\caching.js:68:46)
at cachedFunction.next (<anonymous>)
at loadPresetDescriptor (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:292:44)
at loadPresetDescriptor.next (<anonymous>)
at recurseDescriptors (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:107:30)
at recurseDescriptors.next (<anonymous>)
at loadFullConfig (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\config\full.js:142:6)
at loadFullConfig.next (<anonymous>)
at Function.transform (E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\transform.js:25:45)
at transform.next (<anonymous>)
at step (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:262:25)
at E:\Xampp\htdocs\practice\node_modules\gensync\index.js:266:13
at async.call.result.err.err (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:216:11)
at E:\Xampp\htdocs\practice\node_modules\gensync\index.js:184:28
at E:\Xampp\htdocs\practice\node_modules\@babel\core\lib\gensync-utils\async.js:72:7
at E:\Xampp\htdocs\practice\node_modules\gensync\index.js:108:33
at step (E:\Xampp\htdocs\practice\node_modules\gensync\index.js:280:14)
@ multi ./resources/js/app.js ./resources/sass/app.scss /js/app[0]
ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.
at unknownQuery (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:285:10)
at E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:372:11
at Array.reduce (<anonymous>)
at resolve (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:318:18)
at browserslist (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:443:21)
at Browsers.parse (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:64:12)
at new Browsers (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:46:26)
at loadPrefixes (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:97:20)
at plugin (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:108:20)
at LazyResult.run (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:295:14)
at LazyResult.asyncTick (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:208:26)
at E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:250:14
at new Promise (<anonymous>)
at LazyResult.async (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:246:23)
at LazyResult.then (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:127:17)
at E:\Xampp\htdocs\practice\node_modules\postcss-loader\src\index.js:142:8
at E:\Xampp\htdocs\practice\node_modules\webpack\lib\NormalModule.js:316:20
at E:\Xampp\htdocs\practice\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at E:\Xampp\htdocs\practice\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (E:\Xampp\htdocs\practice\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at E:\Xampp\htdocs\practice\node_modules\postcss-loader\src\index.js:208:9
@ ./resources/sass/app.scss
ERROR in ./resources/sass/app.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!./node_modules/resolve-url-loader??ref--5-4!./node_modules/sass-loader/dist/cjs.js??ref--5-5!./resources/sass/app.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.
at unknownQuery (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:285:10)
at E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:372:11
at Array.reduce (<anonymous>)
at resolve (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:318:18)
at browserslist (E:\Xampp\htdocs\practice\node_modules\browserslist\index.js:443:21)
at Browsers.parse (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:64:12)
at new Browsers (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\browsers.js:46:26)
at loadPrefixes (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:97:20)
at plugin (E:\Xampp\htdocs\practice\node_modules\autoprefixer\lib\autoprefixer.js:108:20)
at LazyResult.run (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:295:14)
at LazyResult.asyncTick (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:208:26)
at E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:250:14
at new Promise (<anonymous>)
at LazyResult.async (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:246:23)
at LazyResult.then (E:\Xampp\htdocs\practice\node_modules\postcss\lib\lazy-result.js:127:17)
at E:\Xampp\htdocs\practice\node_modules\postcss-loader\src\index.js:142:8
@ ./resources/sass/app.scss 2:14-253
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\User\AppData\Roaming\npm-cache\_logs\2020-05-04T09_13_46_636Z-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\User\AppData\Roaming\npm-cache\_logs\2020-05-04T09_13_46_701Z-debug.log
Мой пакет. json:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"@babel/preset-react": "^7.0.0",
"axios": "^0.19",
"bootstrap": "^4.0.0",
"cross-env": "^7.0",
"jquery": "^3.2",
"laravel-mix": "^5.0.1",
"lodash": "^4.17.13",
"popper.js": "^1.12",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"resolve-url-loader": "^3.1.0",
"sass": "^1.15.2",
"sass-loader": "^8.0.0"
}
}