当前位置: 首页 > 知识库问答 >
问题:

无法安装节点sass

漆雕绍晖
2023-03-14

我有一个很多人都有的错误,我认为我在这里找到了一个解决方案。本质上,它是说我的节点版本与node-sass版本不兼容。很多人都有同样的问题,所以我相信链接会有所帮助。然而,当我运行npm安装node-sass@4.14.1时,我得到了一个不同的错误。我知道这是一些简单的修复,但我找不到它!有人明白这是怎么回事吗?

npm ERR! code 1
npm ERR! path C:\Users\reaga\Desktop\bestconnect-react\my-app\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\reaga\Desktop\bestconnect-react\my-app\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\\reaga\\Desktop\\bestconnect-react\\my-app\\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@3.8.0
npm ERR! gyp info using node@15.0.1 | 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 check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:183:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:183:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:183:21)
npm ERR! gyp verb `which` failed  python Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:183:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher 
npm ERR! gyp verb could not find "python". guessing location 
npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack     at callback (C:\Users\reaga\Desktop\bestconnect-react\my-app\node_modules\graceful-fs\polyfills.js:295:20)
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:183:21)
npm ERR! gyp ERR! System Windows_NT 10.0.18362
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\reaga\\Desktop\\bestconnect-react\\my-app\\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\reaga\Desktop\bestconnect-react\my-app\node_modules\node-sass
npm ERR! gyp ERR! node -v v15.0.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

共有3个答案

巢安澜
2023-03-14

首次安装:

npm i节点sass

第二次安装:

npm i

公冶同
2023-03-14

通过从升级的PowerShell(以管理员身份运行)运行npm安装-g窗口构建工具,使用Microsoft的窗口构建工具安装所有所需的工具和配置。

注意:在窗口上工作

https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-设置和配置

东方吕恭
2023-03-14

节点sassv4。节点15上不支持x。降级节点版本或升级到节点sass v5https://github.com/sass/node-sass#node-版本支持策略

 类似资料:
  • 我已经做了很多研究,但在这里空空如也。这是一个又长又丑的IMO。我绝对可以浏览到并成功下载错误中首次引用tar.gz。我所有其他的NPM安装都运行良好。我不是SQLite3的超级粉丝,但我有一个项目需要演示给一些同事。任何帮助得到安装将非常感谢。 sqlite3@3.1.6安装C:\ws\linked10\linkedout\node_modules\sqlite3 node-pre-gyp安装-

  • 问题内容: 所以几周前,我的Eclipse IDE不再允许我远程调试我的应用程序,说它由于未显示行号而无法安装断点…问题是我的Eclipse设置为显示行号(我在日常开发中经常使用) 我进行了一些研究,发现它有时与使用ant来构建项目以及javac中的调​​试设置有关。我确保在我的build.xml目标中设置了调试功能,但仍然无法让我调试相同的错误。 现在,为了加重伤害,我单击了“不再显示此消息”框

  • 当遵循通常的节点安装教程时,我得到以下错误: 我需要修复权限吗?我是目前唯一遇到它的人吗?

  • 当我尝试使用npm安装节点sass时,会收到以下错误消息: 无法下载“https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":" 我使用的命令是: 您可以在下面的屏幕截图中看到更多详细信息:

  • 我正试图在IBM Bluemix上的Node RED中安装redbot。正如这里所建议的,我正在使用管理调色板安装它。我可以通过输入聊天机器人在“安装”选项卡中找到它。我单击安装,然后出现一个弹出窗口说: 安装前,请阅读节点的文档。有些节点具有无法自动解析的依赖项,可能需要重新启动Node RED。 我再次单击install,加载一点后,它会显示以下消息: 安装失败:节点红色contrib聊天机器