您现在的位置是:网站首页 > 代码编程 > WEB前端WEB前端

【原】缺少sass依赖的环境导致npm install失败

不忘初心 不忘初心 2021-11-06 围观() 评论() 点赞() WEB前端

简介:使用eladmin的时候,在npm install时解决了babel的问题之后,又出现了一个关于sass的问题,这次的错误信息提示倒是很明确了,可以一眼就定位问题所在,是关于python和visualstudio的。

使用eladmin的时候,在npm install时解决了babel的问题之后,又出现了一个关于sass的问题,这次的错误信息提示倒是很明确了,可以一眼就定位问题所在,是关于pythonvisualstudio的。

缺少sass依赖的环境导致npm install失败

详细错误信息如下

PS D:\workspace_ued\eladmin-web> npm install
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar@2.1.5: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated querystring@0.2.0: The
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm WARN tarball tarball data for fsevents@https://registry.nlark.com/fsevents/download/fsevents-2.3.2.tgz (sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=) seems to be corrupted. Trying again.
npm WARN tarball tarball data for fsevents@https://registry.nlark.com/fsevents/download/fsevents-2.3.2.tgz (sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=) seems to be corrupted. Trying again.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated microcli@1.3.3: This project has been renamed to @pawelgalazka/cli . Install using @pawelgalazka/cli instead
npm WARN deprecated microargs@1.1.2: This project has been renamed to @pawelgalazka/cli-args. Install using @pawelgalazka/cli-args instead
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated runjs@4.4.2: This project has been renamed to 'tasksfile'. Install using 'npm install tasksfile' instead.
npm WARN deprecated babel-eslint@10.0.1: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN tarball tarball data for fsevents@https://registry.nlark.com/fsevents/download/fsevents-2.3.2.tgz (sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=) seems to be corrupted. Trying again.
npm WARN tarball tarball data for fsevents@https://registry.nlark.com/fsevents/download/fsevents-2.3.2.tgz (sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=) seems to be corrupted. Trying again.
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated svgo@1.2.0: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated highlight.js@9.18.5: Support has ended for 9.x series. Upgrade to @latest
npm WARN deprecated core-js@2.3.0: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 1
00x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to
100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path D:\workspace_ued\eladmin-web\node_modules\deasync
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 node-gyp@7.1.2
npm ERR! gyp info using node@14.15.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "D:\Python\Python39\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 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 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 (C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack at C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack at C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack at C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack at C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator.LAPTOP-9J4HVAON\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\workspace_ued\eladmin-web\node_modules\deasync
npm ERR! gyp ERR! node -v v14.15.2
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\Administrator.LAPTOP-9J4HVAON\AppData\Local\npm-cache\_logs\2021-11-04T06_36_21_325Z-debug.log

可以将整个错误信息拆开两部分看,上面已经明确提到了python的使用路径D:\Python\Python39\python.exe,那说明python是没问题的,下面紧接着又很多find vs的提示,其中有各种not set的字样,我们可以确定是缺失了vs build tools导致的这个错误

在错误信息中还给了一个链接https://github.com/nodejs/node-gyp#on-windows,这个是node-gyp的github仓库地址,我们过去看一下

缺少sass依赖的环境导致npm install失败

这里有两个option,分别对应了两种解决方案,第一种就是我们在install的时候跟一些特定的参数,第二种则是要安装vs的build工具,本文选择第一种方式。

PS D:\workspace_ued\eladmin-web> npm install --global --production windows-build-tools
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated windows-build-tools@5.2.2: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.
added 148 packages in 9s
1 package is looking for funding
run `npm fund` for details

截止到我今天写文章,第一种方式已经不被官方推荐,已经从这段文字中删除了,所以大家最好使用第二种方式,而且在安装完这个tools之后,还需要在node中配置一下

PS D:\workspace_ued\tbk-xcx-admin> npm config set msvs_version 2019

npmnodevue

看完文章,有任何疑问,请加入群聊一起交流!!!

很赞哦! ()

文章评论

  • 请先说点什么
    人参与,条评论

请使用电脑浏览器访问本页面,使用手机浏览器访问本页面会导致下载文件异常!!!

雨落无影

关注上方公众号,回复关键字【下载】获取下载码

用完即删,每次下载需重新获取下载码

若出现下载不了的情况,请及时联系站长进行解决

站点信息

  • 网站程序:spring + freemarker
  • 主题模板:《今夕何夕》
  • 文章统计:篇文章
  • 标签管理标签云
  • 微信公众号:扫描二维码,关注我们