***HTTP error 404 Not Found***
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
gyp verb command configure []
gyp verb download using dist-url https://npmmirror.com/mirrors/node
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 (E:\MyHtmlProcess\online-store\node_modules\_which@1.3.1@which\which.js:13:12)
注意上面用粗体标注的 :意思是下载node-sass/v4.14.1/win32-x64-93_binding.node
第一个是版本,第二个是 404 没有找到。可能是网络的问题吧,
这个可以到官方网站下载:
可以去GitHub找到node-sass的对应版本:
https://github.com/sass/node-sass/releases
node-sass版本,GitHub
PS:(
一开始报错提示的是无法找到 python2.7 建议设置 PYTHON 环境变量,我特意去安装了一个python2 然后设置环境变量,但却无法解决问题。
第一次我没有注意node-sass 的版本,然后直接就下载了一个win32-x64-102_binding.node, 放到一个目录下,然后设置指定的目录:
set SASS_BINARY_PATH=E:\NodeJs\win32-x64-102_binding.node,在执行 npm install
接着下面一个报错。
)
遇到错误二:
Binary found at E:\NodeJs\win32-x64-102_binding.node
Testing binary
Binary has a problem: Error: The module '\\?\E:\NodeJs\win32-x64-102_binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
.......此处内容过长
Building the binary locally
Building: E:\NodeJs\node.exe E:\MyHtmlProcess\online-store\node_modules\_node-gyp@3.8.0@node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --
gyp verb download using dist-url https://npmmirror.com/mirrors/node
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
PS: 这个时候我有重新阅读了一下报的日志信息,意思是我安装的版本不对,让我重新安装93的,我下载的版本问题。同样上面的操作:set SASS_BINARY_PATH=E:\NodeJs\win32-x64-93_binding.node,在执行 npm install
问题解决。一开始下载404 支援没有找到,我用淘宝镜像安装 cnpm 安装的没有成功。
解决问题的时候,还是注意看根本的报错原因,然后再去操作,不然会走弯路。