我是前端开发的新手,现在我必须维护AngularJS应用程序。我正在尝试安装http-server以测试我的应用程序,但是当我运行npm install http-server -g命令时,出现以下错误:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for ecstatic@^3.0.0
npm ERR! notarget In most cases you ir one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'http-server'
npm ERR! notarget
Run Code Online (Sandbox Code Playgroud)
我还没有找到任何解决方案。你们以前看过这个错误吗?
我在解决与 forEach 方法相关的问题时遇到了麻烦。我已经尝试了所有我能想到的编写这段代码的方法,但问题一每次仍然是错误的。
function exerciseOne(names){
// Exercise One: In this exercise you will be given and array called names.
// Using the forEach method and a callback as it's only argument, console log
// each of the names.
}
// MY CODE:
function logNames(name){
console.log(name);
}
names.forEach(logNames);
Run Code Online (Sandbox Code Playgroud)