登录
    Technology changes quickly but people's minds change slowly.

linux 下 npm 安装 node-sass 错误解决

技术宅 破玉 1939次浏览 0个评论

报错信息如下:

gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /home/jjj/.pyenv/shims/python2
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /home/jjj/.pyenv/shims/python2 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack pyenv: python2: command not found
gyp ERR! stack 
gyp ERR! stack The `python2' command exists in these Python versions:
gyp ERR! stack   2.7.6
gyp ERR! stack 
gyp ERR! stack 
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:282:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:947:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
gyp ERR! System Linux 4.4.0-174-generic

看信息应该是 python2 没找到,我们Linux上使用pyenv 管理Python 版本,global 设置的是3.6,所以找不到 python2 ,为此我们将版本切换为2.7.6

pyenv global 2.7.6

然后再安装依赖就好了。


华裳绕指柔, 版权所有丨如未注明 , 均为原创|转载请注明linux 下 npm 安装 node-sass 错误解决
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址