help icon indicating copy to clipboard operation
help copied to clipboard

npm install sass-loader node-sass --legacy-peer-deps

Open tanyixiao opened this issue 5 years ago • 5 comments

Details

用的是vue,在我安装ass-loader node-sass这两个的时候,报错说是找不到har-validator包。我应该要怎么办才好呢

Node.js version

16.6.1

Example code

npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! code 1 npm ERR! path E:\vuefile\电商后台\Xiaoshopping\node_modules\node-sass npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | win32 | x64 npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Users\xiao\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe" 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 checking VS2019 (16.11.31727.386) found at: npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" npm ERR! gyp ERR! find VS - "Visual Studio C++ core features" missing npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use 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 Studio npm 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 (E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:121:47) npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:74:16 npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:351:14) npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:70:14 npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:372:16 npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\util.js:54:7 npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\util.js:33:16 npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28) npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1067:16) npm ERR! gyp ERR! System Windows_NT 10.0.19042 npm ERR! gyp ERR! command "E:\Node\node.exe" "E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd E:\vuefile\电商后台\Xiaoshopping\node_modules\node-sass npm ERR! gyp ERR! node -v v16.6.1 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\xiao\AppData\Local\npm-cache_logs\2021-11-01T03_48_16_151Z-debug.log

Operating system

win10

Scope

npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! code 1 npm ERR! path E:\vuefile\电商后台\Xiaoshopping\node_modules\node-sass npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | win32 | x64 npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Users\xiao\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe" 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 checking VS2019 (16.11.31727.386) found at: npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" npm ERR! gyp ERR! find VS - "Visual Studio C++ core features" missing npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use 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 Studio npm 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 (E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:121:47) npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:74:16 npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:351:14) npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:70:14 npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\find-visualstudio.js:372:16 npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\util.js:54:7 npm ERR! gyp ERR! stack at E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\lib\util.js:33:16 npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28) npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1067:16) npm ERR! gyp ERR! System Windows_NT 10.0.19042 npm ERR! gyp ERR! command "E:\Node\node.exe" "E:\vuefile\电商后台\Xiaoshopping\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd E:\vuefile\电商后台\Xiaoshopping\node_modules\node-sass npm ERR! gyp ERR! node -v v16.6.1 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\xiao\AppData\Local\npm-cache_logs\2021-11-01T03_48_16_151Z-debug.log

Module and version

No response

tanyixiao avatar Nov 01 '21 03:11 tanyixiao

npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio npm 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 **************************************************************

The error is self-explanatory, the error stack tells you that you're missing latest version of Visual Studio and the Desktop development with C++ workload, you should consult the on windows node-gyp documentation.

VoltrexKeyva avatar Nov 05 '21 11:11 VoltrexKeyva

in an administrator command prompt, run:

npm install --global windows-build-tools

this will install Visual Studio 2017

jayjxon avatar Nov 06 '21 11:11 jayjxon

谢谢,已解决

------------------ 原始邮件 ------------------ 发件人: "Jay @.>; 发送时间: 2021年11月6日(星期六) 晚上7:33 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [nodejs/help] npm install sass-loader node-sass --legacy-peer-deps (Issue #3596)

in an administrator command prompt, run: npm install --global windows-build-tools

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

tanyixiao avatar Nov 17 '21 03:11 tanyixiao

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar May 08 '24 01:05 github-actions[bot]

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar Jun 07 '24 01:06 github-actions[bot]