我想macOs用 来配置我的终端zsh。安装后homebrew,当我尝试安装iterm2运行此命令时brew cask install iterm2,错误显示如下:
错误:brew cask不再是brew命令。brew <command> --cask代替使用。
有人可以建议解决它吗?提前致谢!
我正在尝试在电子上创建一个报价小部件。对于渲染器过程,我创建了 index.js 并编码如下
console.log('from renderer');
var request = require('request');
const electron = require('electron');
var url ="https://quotesondesign.com/wp-json/wp/v2/posts/?orderby=rand&_="+rnd;
request(url, function(error, response, body) {
if(error)
{
document.getElementById("quote").innerHTML = 'Unable to fetch the quote plaese check the network connection';
return;
}
let bodyJSON = JSON.parse(body);
console.log(bodyJson);
let randomQuote = bodyJSON[0]["content"]["rendered"];
document.getElementById("quote").innerHTML = randomQuote;
});
Run Code Online (Sandbox Code Playgroud)
而 index.html 有
<div id="quote">
</div>
<script src="index.js">
// require ('index.js');
</script>
Run Code Online (Sandbox Code Playgroud)
如果我require ('index.js');在script标签中使用,它不起作用。所以我使用了src="index.js". 现在,渲染过程的作品,但在控制台上,就说明"Uncaught ReferenceError: require is not defined at index.js:3"
我的第一次查询的是,为什么 …