npm 只是不会安装 Node sass

2024-02-25

我第一次遇到这个问题是在尝试使用 ionic 时,它需要其模板的依赖关系。然后,当我尝试自己使用 npm 安装 node-sass 时,问题仍然存在。这是在Windows 10 Version 1703, both nodejs 6.11.3 and nodejs 8.4.0尝试过,最终得到相同的结果。 VPN、http代理都试过了,但没有成功。基本上,它是在说:

无法下载 ”https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-57_binding.node https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-57_binding.node"

当没有任何事情被摆弄时,它会说:

连接 ECONNREFUSED 127.0.0.1:443

当使用 npm set config proxy 时,它显示如下内容:

无法建立隧道

使用 VPN 时,它会永远等待:

节点脚本/install.js

或输出与没有任何改动一样。

报告错误时,您必须提供以下信息:

  • NPM版本(npm -v):5.3.0,节点最新(8.4.0),默认版本 与节点 6.11.3
  • 节点版本(节点-v):LTS(6.11.3)和LATEST(8.4.0)
  • 节点进程(节点-p process.versions):

    { http_parser: '2.7.0', 节点: '8.4.0', v8: '6.0.286.52', uv: '1.13.1',zlib:'1.2.11',战神:'1.10.1-DEV',模块:'57',nghttp2: '1.22.0',openssl:'1.0.2l',icu:'59.1',unicode:'9.0',cldr: '31.0.1',tz:'2017b'}

  • 节点平台(node -p process.platform):win32
  • 节点架构(node -p process.arch):x64
  • node-sass 版本(node -p“require('node-sass').info”):错误: 找不到模块“node-sass”
  • npm node-sass 版本 (npm ls node-sass): `-- (空)

有输出

---> npm install -g node-sass
C:\Users\rick\AppData\Roaming\npm\node-sass -> C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\bin\node-sass

> [email protected] /cdn-cgi/l/email-protection install C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-57_binding.node":

connect ECONNREFUSED 127.0.0.1:443

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> [email protected] /cdn-cgi/l/email-protection postinstall C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using [email protected] /cdn-cgi/l/email-protection
gyp info using [email protected] /cdn-cgi/l/email-protection | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Program Files\Python36\python.EXE
gyp verb check python version `C:\Program Files\Python36\python.EXE -c "import platform; print(platform.python_version());"` returned: "3.6.2\r\n"
gyp verb could not find "C:\Program Files\Python36\python.EXE". checking python launcher
gyp verb could not find "C:\Program Files\Python36\python.EXE". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python36\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\rick\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\rick\AppData\Roaming\npm\node_modules\node-sass
gyp ERR! node -v v8.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] /cdn-cgi/l/email-protection postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] /cdn-cgi/l/email-protection postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\rick\AppData\Roaming\npm-cache\_logs\2017-09-10T18_52_13_062Z-debug.log

然后有人告诉我:

Well ECONNREFUSED很简单 - 你已经配置了 npm 来与 代理位于 127.0.0.1 (localhost) 端口 443 但代理似乎没有 对该端口处于活动状态。请检查代理/VPN 软件配置 - 端口号必须匹配。

但问题是我没有配置代理。我试过npm config rm proxy,and npm config delete proxy,我什至尝试使用它并设置一个代理,然后将 npm 指向该代理,就像我上面描述的那样,没有任何效果。这是 powershell 环境配置,以防万一:

⚡ rick@DESKTOP-1NVA03E  ~  $reg = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

⚡ rick@DESKTOP-1NVA03E  ~  $settings = Get-ItemProperty -Path $reg                                                    

⚡ rick@DESKTOP-1NVA03E  ~  $settings.ProxyServer
127.0.0.1:1080 

⚡ rick@DESKTOP-1NVA03E  ~  $settings.ProxyEnable
0

我刚刚遇到了同样的问题。通过在 C:\Python27\ 中安装 Python v2.7 解决了这个问题。 (我以前只在 C:\Program Files\Python36\ 中安装了 Python 3.6 )

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

npm 只是不会安装 Node sass 的相关文章

随机推荐

  • 从另一个文件执行 php

    我有 1 个模板文件 它包含在主文件中 一些模板 在主文件中 我将文件读入 1 个变量并显示它 当然 php 脚本不会在那里运行 我怎样才能做到这一点 我想要什么 Thanks 你可以使用include读取并处理文件 如果您需要对结果进行后
  • 如何“newtype”IntSet?

    谢谢newtype和GeneralizedNewtypeDeriving扩展 我们可以毫不费力地定义不同的轻量级类型 newtype PersonId PersonId Int deriving Eq Ord Show NFData new
  • JavaScript 中仍然不推荐“new”吗?

    所以我看到很多 JavaScript 代码在创建构造函数时使用 new 在阅读了 JavaScript the Good Parts 的一部分之后 似乎使用 new 并不是猫的睡衣 那是4年前的事了 还是不推荐吗 目前的标准是什么 从什么时
  • 相当于 PHP multi_query 的 Codeigniter 是什么

    使用 PHP 我编写了一个像这样的多重查询 MySQL string UPDATE table SET name joe WHERE ID 1 MySQL string UPDATE table SET name Jane WHERE ID
  • tstr在一轮中拆分到不同的列

    我有一个如下表 myDT lt fread id other strformat content 1 other1 A B a1 b1 2 other2 A C a2 c2 3 other3 B A C b3 a3 c3 4 other4
  • Objective-C 运行时如何检索类和方法的列表?

    如果我得到以下 Objective C 源文件 test m import
  • 如何在 Kotlin 中解析 JSON?

    我从服务接收到一个相当深的 JSON 对象字符串 我必须将其解析为 JSON 对象 然后将其映射到类 如何将 JSON 字符串转换为 Kotlin 中的对象 在映射到各个类之后 我使用了 Jackson 的 StdDeserializer
  • 使用斯坦福 NER 从文本文档中提取地址?

    我正在寻找斯坦福大学NER http nlp stanford edu software CRF NER shtml并考虑使用 JAVA API 从文本文档中提取邮政地址 该文件可以是任何包含邮政地址部分的文件 例如水电费 电费 所以我的想
  • NSRefreshedObjectsKey 的用途

    In a NSManagedObjectContextObjectsDidChangeNotification通知 我有时会收到NSRefreshedObjectsKey key 我明白刷新的对象 https developer apple
  • puma 是唯一的多线程 Rails 4 http 服务器吗?

    我已经将我们的堆栈转换为 Rails 4 是的 我希望利用线程安全代码 Puma 的工作是起床 停止它似乎是一个不同的问题 Puma 是唯一的多螺纹导轨吗 Thin gt EventMachine Unicorn gt Forking Pu
  • git:补丁没有有效的电子邮件地址

    我有一个补丁文件 我想将此补丁应用到 git 存储库中的代码 当我使用 subversion 时 这个过程非常简单 右键 gt tortoise svn gt 应用补丁 它总是按我的预期工作 但我不能使用 git 来做到这一点 Git 不应
  • EasyAdmin 3.X - 如何查看相关实体`toString`而不是列表中关联的数量?

    我有一个实体Product与实体具有多对多关系Category ORM ManyToMany targetEntity App Domain Category inversedBy stalls private categories ret
  • ADT什么时候将BuildConfig.DEBUG设置为false?

    在最新版本的 ADT r17 中添加了生成常数BuildConfig DEBUG这是根据构建类型设置的 我遇到的问题是它永远不会设置为 false 我希望它在执行 Android 工具 gt 导出签名应用程序包 时发生变化 但它对我来说没有
  • 替换 Word 2003 文档中的 MergeFields 并保持样式

    我一直在尝试创建一个库来替换 Word 2003 文档上的 MergeFields 一切正常 除了在替换时丢失了应用于该字段的样式之外 有没有办法保留它 这是我用来替换字段的代码 private void FillFields2003 st
  • git 如何跳转到第一个提交? [复制]

    这个问题在这里已经有答案了 如何跳转到 git 存储库中的第一个提交 另外 有没有办法通过网站在Github上做到这一点 要进行存储库的第一次提交 请执行以下操作 git checkout master git log reverse 输出
  • Jquery加载然后编辑加载的内容

    我正在使用 Jquery 加载 然后一旦内容加载到 div 中 我想将一些标签更改为语言相关变量 我的问题是我必须使用 settimeout 来让脚本等待足够长的时间以便元素准备好编辑 当我使用回调函数参数时 我想要编辑的元素显然还没有准备
  • 用作 ng-if 的指令 (Angular 2)

    我正在尝试创建一个作为 ngIf 工作的指令来控制是否允许具有正确权限的用户查看特定内容 如下所示 div h3 You are allow to see this h3 div 我正在阅读有关如何做到这一点的信息 并发现了这一点doc h
  • Python 中精确的循环计时

    For 这个项目 http www samplerbox org我正在设计一个音序器 鼓机 它应该能够以精确的速度发送 MIDI 音符 示例 每 2 秒 16 个音符 即在音乐术语中 每小节 16 个 1 16 音符 BPM 120 即每
  • 为什么显示名称未显示在日历活动参加者中?

    我使用以下代码要点成功检索日历活动参加者 require once DIR vendor autoload php putenv GOOGLE APPLICATION CREDENTIALS DIR mt service account j
  • npm 只是不会安装 Node sass

    我第一次遇到这个问题是在尝试使用 ionic 时 它需要其模板的依赖关系 然后 当我尝试自己使用 npm 安装 node sass 时 问题仍然存在 这是在Windows 10 Version 1703 both nodejs 6 11 3