无法安装node-sass,一直报错

来源:2-2 开发准备工作(生成字体图标)

ForCoke

2021-10-30 14:50

:\workspace_webstore\09.vue电子书项目\my_ebook_free> npm install node-sass

npm ERR! code 1

npm ERR! path H:\workspace_webstore\09.vue电子书项目\my_ebook_free\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 node-gyp@7.1.2

npm ERR! gyp info using node@14.17.3 | win32 | x64

npm ERR! gyp ERR! find Python

npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration

npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON

npm ERR! gyp ERR! find Python checking if "python3" can be used

npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error

npm ERR! gyp ERR! find Python checking if "python" can be used

npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error

npm ERR! gyp ERR! find Python checking if "python2" can be used

npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error

npm ERR! gyp ERR! find Python checking if Python is C:\Python37\python.exe

npm ERR! gyp ERR! find Python - "C:\Python37\python.exe" could not be run

npm ERR! gyp ERR! find Python checking if Python is C:\Python27\python.exe

npm ERR! gyp ERR! find Python - "C:\Python27\python.exe" could not be run

npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python

npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error

npm ERR! gyp ERR! find Python

npm ERR! gyp ERR! find Python **********************************************************

npm ERR! gyp ERR! find Python You need to install the latest version of Python.

npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,

npm ERR! gyp ERR! find Python you can try one of the following options:

npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"

npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)

npm ERR! gyp ERR! find Python - Set the environment variable PYTHON

npm ERR! gyp ERR! find Python - Set the npm configuration variable python:

npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"

npm ERR! gyp ERR! find Python For more information consult the documentation at:

npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation

npm ERR! gyp ERR! find Python **********************************************************

npm ERR! gyp ERR! find Python

npm ERR! gyp ERR! configure error

npm ERR! gyp ERR! stack Error: Could not find any Python installation to use

npm ERR! gyp ERR! stack     at PythonFinder.fail (H:\workspace_webstore\09.vue电子书项目\my_ebook_free\node_modules\node-gyp\lib\find-python.js:302:47)

npm ERR! gyp ERR! stack     at PythonFinder.runChecks (H:\workspace_webstore\09.vue电子书项目\my_ebook_free\node_modules\node-gyp\lib\find-python.js:136:21)

npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (H:\workspace_webstore\09.vue电子书项目\my_ebook_free\node_modules\node-gyp\lib\find-python.js:200:18)

npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (H:\workspace_webstore\09.vue电子书项目\my_ebook_free\node_modules\node-gyp\lib\find-python.js:266:16)

npm ERR! gyp ERR! stack     at exithandler (child_process.js:326:5)

npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:338:5)

npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:375:28)

npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

npm ERR! gyp ERR! stack     at onErrorNT (internal/child_process.js:467:16)

npm ERR! gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)

npm ERR! gyp ERR! System Windows_NT 10.0.17134

npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "H:\\workspace_webstore\\09.vue电子书项目\\my_ebook_free\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"

npm ERR! gyp ERR! cwd H:\workspace_webstore\09.vue电子书项目\my_ebook_free\node_modules\node-sass

npm ERR! gyp ERR! node -v v14.17.3

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\11482\AppData\Local\npm-cache\_logs\2021-10-30T06_36_25_492Z-debug.log


写回答 关注

2回答

  • 帝国大学
    2022-07-07 14:47:31

    关于gyp ERR node-gyp gyp ERR node -v错误记录

    npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
    npm install node-sass
  • weixin_慕姐9014891
    2021-11-17 15:30:27

    -===

    qq_慕瓜9...

    直接安装sass解析器就行

    2021-12-24 22:41:56

    共 1 条回复 >

快速入门Web阅读器开发

带你了解电子书阅读器的工作原理,通过Vue.js快速实现Web阅读器

26396 学习 · 214 问题

查看课程

相似问题