npm install时出现gyp ERR! stack Error: Could not find any Python installation to use

叁歲伎倆 2022-08-28 04:58 107阅读 0赞

vue项目使用npm install按照依赖时,报以下错误:

  1. gyp verb command rebuild []
  2. gyp verb command clean []
  3. gyp verb clean removing "build" directory
  4. gyp verb command configure []
  5. gyp verb find Python Python is not set from command line or npm configuration
  6. gyp verb find Python Python is not set from environment variable PYTHON
  7. gyp verb find Python checking if "python3" can be used
  8. gyp verb find Python - executing "python3" to get executable path
  9. gyp verb find Python - "python3" is not in PATH or produced an error
  10. gyp verb find Python checking if "python" can be used
  11. gyp verb find Python - executing "python" to get executable path
  12. gyp verb find Python - "python" is not in PATH or produced an error
  13. gyp verb find Python checking if "python2" can be used
  14. gyp verb find Python - executing "python2" to get executable path
  15. gyp verb find Python - "python2" is not in PATH or produced an error
  16. gyp verb find Python checking if Python is C:\Python37\python.exe
  17. gyp verb find Python - executing "C:\Python37\python.exe" to get version
  18. gyp verb find Python - "C:\Python37\python.exe" could not be run
  19. gyp verb find Python checking if Python is C:\Python27\python.exe
  20. gyp verb find Python - executing "C:\Python27\python.exe" to get version
  21. gyp verb find Python - "C:\Python27\python.exe" could not be run
  22. gyp verb find Python checking if the py launcher can be used to find Python
  23. gyp verb find Python - executing "py.exe" to get Python executable path
  24. gyp verb find Python - "py.exe" is not in PATH or produced an error
  25. gyp ERR! find Python
  26. gyp ERR! find Python Python is not set from command line or npm configuration
  27. gyp ERR! find Python Python is not set from environment variable PYTHON
  28. gyp ERR! find Python checking if "python3" can be used
  29. gyp ERR! find Python - "python3" is not in PATH or produced an error
  30. gyp ERR! find Python checking if "python" can be used
  31. gyp ERR! find Python - "python" is not in PATH or produced an error
  32. gyp ERR! find Python checking if "python2" can be used
  33. gyp ERR! find Python - "python2" is not in PATH or produced an error
  34. gyp ERR! find Python checking if Python is C:\Python37\python.exe
  35. gyp ERR! find Python - "C:\Python37\python.exe" could not be run
  36. gyp ERR! find Python checking if Python is C:\Python27\python.exe
  37. gyp ERR! find Python - "C:\Python27\python.exe" could not be run
  38. gyp ERR! find Python checking if the py launcher can be used to find Python
  39. gyp ERR! find Python - "py.exe" is not in PATH or produced an error
  40. gyp ERR! find Python
  41. gyp ERR! find Python **********************************************************
  42. gyp ERR! find Python You need to install the latest version of Python.
  43. gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
  44. gyp ERR! find Python you can try one of the following options:
  45. gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
  46. gyp ERR! find Python (accepted by both node-gyp and npm)
  47. gyp ERR! find Python - Set the environment variable PYTHON
  48. gyp ERR! find Python - Set the npm configuration variable python:
  49. gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
  50. gyp ERR! find Python For more information consult the documentation at:
  51. gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
  52. gyp ERR! find Python **********************************************************
  53. gyp ERR! find Python
  54. gyp ERR! configure error
  55. gyp ERR! stack Error: Could not find any Python installation to use
  56. gyp ERR! stack at PythonFinder.fail (E:\project\DBApi-master\dbapi-ui\node_modules\node-gyp\lib\find-python.js:302:47)
  57. gyp ERR! stack at PythonFinder.runChecks (E:\project\DBApi-master\dbapi-ui\node_modules\node-gyp\lib\find-python.js:136:21)
  58. gyp ERR! stack at PythonFinder.<anonymous> (E:\project\DBApi-master\dbapi-ui\node_modules\node-gyp\lib\find-python.js:200:18)
  59. gyp ERR! stack at PythonFinder.execFileCallback (E:\project\DBApi-master\dbapi-ui\node_modules\node-gyp\lib\find-python.js:266:16)
  60. gyp ERR! stack at exithandler (child_process.js:390:5)
  61. gyp ERR! stack at ChildProcess.errorhandler (child_process.js:402:5)
  62. gyp ERR! stack at ChildProcess.emit (events.js:400:28)
  63. gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
  64. gyp ERR! stack at onErrorNT (internal/child_process.js:469:16)
  65. gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:82:21)
  66. gyp ERR! System Windows_NT 10.0.19042
  67. gyp ERR! command "D:\\nodejs\\node.exe" "E:\\project\\DBApi-master\\dbapi-ui\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
  68. gyp ERR! cwd E:\project\DBApi-master\dbapi-ui\node_modules\node-sass
  69. gyp ERR! node -v v14.18.1
  70. gyp ERR! node-gyp -v v7.1.2
  71. gyp ERR! not ok
  72. Build failed with error code: 1
  73. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\chokidar\node_modules\fsevents):
  74. npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted { "os":"darwin","arch":"any"} (current: { "os":"win32","arch":"x64"})
  75. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
  76. npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted { "os":"darwin","arch":"any"} (current: { "os":"win32","arch":"x64"})
  77. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
  78. npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted { "os":"darwin","arch":"any"} (current: { "os":"win32","arch":"x64"})
  79. npm ERR! code ELIFECYCLE
  80. npm ERR! errno 1
  81. npm ERR! node-sass@5.0.0 postinstall: `node scripts/build.js`
  82. npm ERR! Exit status 1
  83. npm ERR!
  84. npm ERR! Failed at the node-sass@5.0.0 postinstall script.
  85. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  86. npm ERR! A complete log of this run can be found in:
  87. npm ERR! C:\Users\WRD\AppData\Roaming\npm-cache\_logs\2021-10-20T05_42_34_767Z-debug.log

这是由于缺少python依赖导致的,在python官网下载并安装后,删除依赖重新执行npm install即可

发表评论

表情:
评论列表 (有 0 条评论,107人围观)

还没有评论,来说两句吧...

相关阅读