node-gyp 报错-if not defined npm_config_node_gyp

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了node-gyp 报错-if not defined npm_config_node_gyp相关的知识,希望对你有一定的参考价值。

参考技术A 1、全局安装 node-gyp

2、

1、项目地址中有中文也会这个报错
2、不要用镜像去装,容易出幺蛾子

js火狐报错event is not defined

<!--
var tPopWait = 50;
var tPopShow = 60000;
var showPopStep = 30;
var popOpacity = 95;
var fontcolor = "#000000";
var bgcolor = "white";
var bordercolor = "black";
var sPop=null;
var curShow=null;
var tFadeOut=null;
var tFadeIn=null;
var tFadeWaiting=null;
var snapPanel = "";
snapPanel += "<style type='text/css'id='defaultPopStyle'>";
snapPanel += ".cPopText background-color: "+bgcolor+";color:"+fontcolor+"; border: 1px "+bordercolor+" solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 300px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)";
snapPanel += "</style>";
snapPanel += "<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>";
document.body.innerHTML += snapPanel;
function showPopupText()

try
var o= event.srcElement;
if(o.id == "dypopLayer")
return;
MouseX = event.x;
MouseY = event.y;
if(o.tagName=="A" && o.dypop!=undefined && o.dypop!=null && o.dypop!="")

o.dypop=o.dypop;
if(o.alt!=null&&o.alt!="")

o.alt=""

if(o.title!=null&&o.title!="")

o.title=""

document.title = o.dypop;

if(o.dypop!=sPop)

sPop = o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting);
if(sPop==null||sPop=="")

dypopLayer.innerHTML="";
dypopLayer.style.filter="Alpha()";
dypopLayer.filters.Alpha.opacity=0;

else

if(o.dyclass!=null)popStyle=o.dyclass
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);



catch(e)

alert(e);


//避免重复引发onload
function changeImage(img,url)
if(img.src==sServiceUrlRoot+"/Caches/loading.gif")
img.src = url;


function showIt()

dypopLayer.className=popStyle;

var key=Math.floor( Math.random() * 2000000);
var imageHtml = "<iframe width='320' height='238' border='1' src='" + sPop + "' style='zoom:0.3;'></iframe>";
dypopLayer.style.width = 320;
dypopLayer.style.height = 240;
popWidth=dypopLayer.clientWidth;
popHeight=dypopLayer.clientHeight;
dypopLayer.innerHTML= imageHtml;
if(MouseX+12+popWidth>document.body.clientWidth)popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight)popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
dypopLayer.style.filter="Alpha(Opacity=0)";
fadeOut();

function fadeOut()

if(dypopLayer.filters.Alpha.opacity<popOpacity)

dypopLayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);

else

dypopLayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);


function fadeIn()

if(dypopLayer.filters.Alpha.opacity>0)

dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);


document.onmouseover=showPopupText;
-->

  您好!很高兴为您答疑!

  火狐不能直接调用 event 对象。 需要通过函数参数传递事件对象。
  您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
参考技术A FireFox 不能直接调用 event 对象. FireFox需要通过函数参数传递事件对象.追问

那这个需要怎么改呢?

追答

试试在 showPopupText() 函数的第一行加如下代码
var event = arguments[0]||window.event;
然后你再测试看看吧, 太码太长了, 没有通读. 只大概看了一眼.

追问

哦,好的,谢谢啦

本回答被提问者采纳

以上是关于node-gyp 报错-if not defined npm_config_node_gyp的主要内容,如果未能解决你的问题,请参考以下文章

小程序app is not defined

jQuery报错$ is not defined

调用js报错 错误: $ is not defined

js火狐报错event is not defined

报错:Uncaught ReferenceError: input is not defined

echarts报错ReferenceError: require is not defined