اذهب إلى المحتوى

السؤال

Recommended Posts

  • 0
نشر

في حال كنت تستخدم webpack تأكد من إضافة الخيار writeToDisk ضمن الملف webpack.config.js ليتم كتابة الملفات بعد التحزيم إلى ملف الوجهة كالتالي:

devServer: {
  devMiddleware: {
    writeToDisk: true
  }
}

في حال كنت تستخدم إصدار webpack 3 أو قبل يكون كالتالي: 

devServer: {
  writeToDisk: true
}

 

  • 0
نشر
بتاريخ 2 دقائق مضت قال Hassan Hedr:

في حال كنت تستخدم webpack تأكد من إضافة الخيار writeToDisk ضمن الملف webpack.config.js ليتم كتابة الملفات بعد التحزيم إلى ملف الوجهة كالتالي:


devServer: {
  devMiddleware: {
    writeToDisk: true
  }
}

في حال كنت تستخدم إصدار webpack 3 أو قبل يكون كالتالي: 


devServer: {
  writeToDisk: true
}

 

انا عملت clone لمشروع انا كنت عامله وجيت اعمل npm install --force طلعلي الerror ده 

npm ERR! code 1
npm ERR! path C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\70DA\\Desktop\\coffee_project\\coffee_project\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON 
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path       
npm ERR! gyp verb find Python - executable path is "C:\Users\70DA\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
npm ERR! gyp verb find Python - executing "C:\Users\70DA\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe" to get 
version
npm ERR! gyp verb find Python - version is "3.9.12"
npm ERR! gyp info find Python using Python version 3.9.12 found at "C:\Users\70DA\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.14.0
npm ERR! gyp verb command install [ '16.14.0' ]
npm ERR! gyp verb install input version string "16.14.0"
npm ERR! gyp verb install installing version: 16.14.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.14.0
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? Yes
npm ERR! gyp verb find VS msvs_version not set from command line or npm config   
npm ERR! gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt 
npm ERR! gyp verb find VS could not use PowerShell to find Visual Studio 2017 or 
newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp verb find VS looking for Visual Studio 2015
npm ERR! gyp verb find VS - not found
npm ERR! gyp verb find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config   
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt 
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or 
newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studionpm ERR! gyp ERR! find VS including the "Desktop development with C++" workload. 
npm ERR! gyp ERR! find VS For more information consult the documentation at:     
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:122:47)npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\70DA\\Desktop\\coffee_project\\coffee_project\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="     
npm ERR! gyp ERR! cwd C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\70DA\AppData\Local\npm-cache\_logs\2022-04-15T15_30_45_963Z-debug-0.log

 

  • 0
نشر
بتاريخ 2 دقائق مضت قال Mohamed Montaser3:

انا عملت clone لمشروع انا كنت عامله وجيت اعمل npm install --force طلعلي الerror ده 


npm ERR! code 1
npm ERR! path C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\70DA\\Desktop\\coffee_project\\coffee_project\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON 
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path       
npm ERR! gyp verb find Python - executable path is "C:\Users\70DA\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
npm ERR! gyp verb find Python - executing "C:\Users\70DA\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe" to get 
version
npm ERR! gyp verb find Python - version is "3.9.12"
npm ERR! gyp info find Python using Python version 3.9.12 found at "C:\Users\70DA\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.14.0
npm ERR! gyp verb command install [ '16.14.0' ]
npm ERR! gyp verb install input version string "16.14.0"
npm ERR! gyp verb install installing version: 16.14.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.14.0
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? Yes
npm ERR! gyp verb find VS msvs_version not set from command line or npm config   
npm ERR! gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt 
npm ERR! gyp verb find VS could not use PowerShell to find Visual Studio 2017 or 
newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp verb find VS looking for Visual Studio 2015
npm ERR! gyp verb find VS - not found
npm ERR! gyp verb find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config   
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt 
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or 
newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studionpm ERR! gyp ERR! find VS including the "Desktop development with C++" workload. 
npm ERR! gyp ERR! find VS For more information consult the documentation at:     
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:122:47)npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\70DA\\Desktop\\coffee_project\\coffee_project\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="     
npm ERR! gyp ERR! cwd C:\Users\70DA\Desktop\coffee_project\coffee_project\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\70DA\AppData\Local\npm-cache\_logs\2022-04-15T15_30_45_963Z-debug-0.log

 

هذا الخطأ لا علاقة له بالسؤال الأساسي، حاول تنفيذ أمر التثبيت كالتالي:

npm install --ignore-scripts

 

  • 0
نشر
بتاريخ 4 دقائق مضت قال Hassan Hedr:

هذا الخطأ لا علاقة له بالسؤال الأساسي، حاول تنفيذ أمر التثبيت كالتالي:


npm install --ignore-scripts

 

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: coffee-drink@1.0.0
npm ERR! Found: webpack@5.72.0
npm ERR! node_modules/webpack
npm ERR!   webpack@"^5.70.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from optimize-css-assets-webpack-plugin@6.0.1
npm ERR! node_modules/optimize-css-assets-webpack-plugin
npm ERR!   dev optimize-css-assets-webpack-plugin@"^6.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See C:\Users\70DA\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\70DA\AppData\Local\npm-cache\_logs\2022-04-15T15_45_35_622Z-debug-0.log

 

  • 0
نشر
بتاريخ 1 دقيقة مضت قال Mohamed Montaser3:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: coffee-drink@1.0.0
npm ERR! Found: webpack@5.72.0
npm ERR! node_modules/webpack
npm ERR!   webpack@"^5.70.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from optimize-css-assets-webpack-plugin@6.0.1
npm ERR! node_modules/optimize-css-assets-webpack-plugin
npm ERR!   dev optimize-css-assets-webpack-plugin@"^6.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See C:\Users\70DA\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\70DA\AppData\Local\npm-cache\_logs\2022-04-15T15_45_35_622Z-debug-0.log

 

حاول تنفيذ الأمر كالتالي:

npm install --ignore-scripts --legacy-peer-deps

 

  • 0
نشر
بتاريخ 2 دقائق مضت قال Hassan Hedr:

حاول تنفيذ الأمر كالتالي:


npm install --ignore-scripts --legacy-peer-deps

 

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: coffee-drink@1.0.0
npm ERR! Found: webpack@5.72.0
npm ERR! node_modules/webpack
npm ERR!   webpack@"^5.70.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from optimize-css-assets-webpack-plugin@6.0.1
npm ERR! node_modules/optimize-css-assets-webpack-plugin
npm ERR!   dev optimize-css-assets-webpack-plugin@"^6.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See C:\Users\70DA\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\70DA\AppData\Local\npm-cache\_logs\2022-04-15T15_45_35_622Z-debug-0.log
PS C:\Users\70DA\Desktop\coffee_project\coffee_project> npm install --ignore-scripts --legacy-peer-deps
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

added 621 packages, and audited 622 packages in 2m

61 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

  • 0
نشر
بتاريخ 4 دقائق مضت قال Mohamed Montaser3:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: coffee-drink@1.0.0
npm ERR! Found: webpack@5.72.0
npm ERR! node_modules/webpack
npm ERR!   webpack@"^5.70.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from optimize-css-assets-webpack-plugin@6.0.1
npm ERR! node_modules/optimize-css-assets-webpack-plugin
npm ERR!   dev optimize-css-assets-webpack-plugin@"^6.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See C:\Users\70DA\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\70DA\AppData\Local\npm-cache\_logs\2022-04-15T15_45_35_622Z-debug-0.log
PS C:\Users\70DA\Desktop\coffee_project\coffee_project> npm install --ignore-scripts --legacy-peer-deps
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

added 621 packages, and audited 622 packages in 2m

61 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

هل كان يعمل المشروع من قبل، بما أنك تستخدم إصدار 5 webpack فيجب استخدام الإضافة css-minimizer-webpack-plugin بدلًا من optimize-css-assets-webpack-plugin

بدل ذلك في اعتماديات المشروع وأعد عملية التثبيت مع الحرص على استخدام الاضافة الجديدة بدل من القديمة بشكل صحيح ضمن webpack.config.js

 

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...