为什么装node-sass 总是报这个错误呢? 别的文件夹就不报错,就这个文件夹报错?
√ Installed 1 packages
√ Linked 168 latest versions
Downloading binary from https://cdn.npm.taobao.org/di...
Cannot download "https://cdn.npm.taobao.org/dist/node-sass/v3.13.1/win32-x64-57_binding.node":
HTTP error 404 Not Found
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
Building: C:Program Filesnodejsnode.exe F:01node_modules_node-gyp@3.8.0@node-gypbinnode-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 'F:\01\node_modules\_node-gyp@3.8.0@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 node-gyp@3.8.0
gyp info using node@8.11.3 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb download using dist-url https://npm.taobao.org/mirror...
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 (F:01node_modules_which@1.3.1@whichwhich.js:13:12)
gyp verb which
failed at F (F:01node_modules_which@1.3.1@whichwhich.js:68:19)
gyp verb which
failed at E (F:01node_modules_which@1.3.1@whichwhich.js:80:29)
gyp verb which
failed at F:01node_modules_which@1.3.1@whichwhich.js:89:16
gyp verb which
failed at F:01node_modules_isexe@2.0.0@isexeindex.js:42:5
gyp verb which
failed at F:01node_modules_isexe@2.0.0@isexewindows.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 (F:01node_modules_which@1.3.1@whichwhich.js:13:12)
gyp verb which
failed at F (F:01node_modules_which@1.3.1@whichwhich.js:68:19)
gyp verb which
failed at E (F:01node_modules_which@1.3.1@whichwhich.js:80:29)
gyp verb which
failed at F:01node_modules_which@1.3.1@whichwhich.js:89:16
gyp verb which
failed at F:01node_modules_isexe@2.0.0@isexeindex.js:42:5
gyp verb which
failed at F:01node_modules_isexe@2.0.0@isexewindows.js:36:5
gyp verb which
failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb which
failed stack: 'Error: not found: python2n at getNotFoundError (F:\01\node_modules\_which@1.3.1@which\which.js:13:12)n at F (F:\01\node_modules\_which@1.3.1@which\which.js:68:19)n at E (F:\01\node_modules\_which@1.3.1@which\which.js:80:29)n at F:\01\node_modules\_which@1.3.1@which\which.js:89:16n at F:\01\node_modules\_isexe@2.0.0@isexe\index.js:42:5n at F:\01\node_modules\_isexe@2.0.0@isexe\windows.js:36:5n 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:UsersLJXPCAppDataLocalProgramsPythonPython36python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:UsersLJXPCAppDataLocalProgramsPythonPython36python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:557:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "F:\01\node_modules\_node-gyp@3.8.0@node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd F:01node_modules_node-sass@3.13.1@node-sass
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
× Install fail! Error: post install error, please remove node_modules before retry!
Run "C:WINDOWSsystem32cmd.exe /d /s /c node scripts/build.js" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "C:WINDOWSsystem32cmd.exe /d /s /c node scripts/build.js" error, exit code 1
at ChildProcess.proc.on.code (C:\Users\LJXPC\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:74:21)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
npminstall version: 3.9.2
npminstall args: C:Program Filesnodejsnode.exe C:UsersLJXPCAppDataRoamingnpmnode_modulescnpmnode_modulesnpminstallbininstall.js --fix-bug-versions --china --userconfig=C:UsersLJXPC.cnpmrc --disturl=https://npm.taobao.org/mirror... --registry=https://registry.npm.taobao.org node-sass --seve-dev
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
换npm源吧
换个node-sass版本,这个版本没有预编译的二进制文件
要么就别用cnpm装
网上给的各种答案 npm/node版本 以及npm/cnpm/yarn等 依然成功不了。简单粗暴的方式就是拿同事的包丢进去or自己网上下载一个相应版本的包丢进去,然后再npm install一遍。 -- 即安装失败之后自己下载一个方法哦node_modules中
看一下自己npm的源和package-lock里的源是不是同一个 不是的切一下就好了
卸载python3,重新安装python2,环境变量替换成2的安装路径