我在Mac上运行El Capitan.我有节点v5.6.0和npm v3.6.0.当我尝试运行nodemon时,我得到:
-bash: nodemon: command not found
Run Code Online (Sandbox Code Playgroud)
我认为这可能意味着我没有安装nodemon,所以当我尝试使用...时安装它
sudo npm install -g nodemon
Run Code Online (Sandbox Code Playgroud)
......我明白了:
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "nodemon"
npm ERR! node v5.6.0
npm ERR! npm v3.6.0
npm ERR! path /usr/local/bin/nodemon
npm ERR! code EEXIST
npm ERR! Refusing to delete /usr/local/bin/nodemon: ../lib/node_modules/nodemon/nodemon.js symlink target is not controlled by npm /usr/local
npm ERR! File exists: /usr/local/bin/nodemon
npm ERR! Move it away, and try again.
npm ERR! Please include the following file with any …Run Code Online (Sandbox Code Playgroud) 我用Homebrew安装了MongoDB.我还创建了一个名为/ data/db的目录.
但是,当我运行mongod时,我收到此消息:
exception in initAndListen: 98 Unable to lock file: /data/db/mongod.lock Resource temporarily unavailable. Is a mongod instance already running?, terminating
Run Code Online (Sandbox Code Playgroud)
我怀疑它已经在运行,因为我刚安装它.我已退出终端并重新启动,但它没有帮助.
这是我的终端的截图
知道我需要做什么吗?谢谢!
我安装了MAMP,我从未遇到过问题.今天我尝试登录到PHPMyAdmin,我收到以下错误消息:
1045 - 用户'root'@'localhost'拒绝访问(使用密码:YES)
在我的config.inc.php文件中,设置了以下选项:
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'root';
Run Code Online (Sandbox Code Playgroud)
我从未更改过我的密码.这是本地安装,所以我总是使用'root'作为用户名和密码.
我试过通过终端访问MySQL:
/Applications/MAMP/Library/bin/mysql
Run Code Online (Sandbox Code Playgroud)
但我明白了:
ERROR 1045 (28000): Access denied for user 'boneill'@'localhost' (using password: NO)
Run Code Online (Sandbox Code Playgroud)
不确定会发生什么.我没有更改密码或类似的东西.它突然停止了工作.有任何想法吗?
编辑:这是我试图分页的当前代码。它创建一个自定义查询,不包括最新帖子以及一个类别中的所有帖子。分页在大多数情况下都可以正常工作,但是问题是分页列表中的最后一个链接将我带到了空白页。
<section class="card-grid card-grid--push">
<main class="container container--wide">
<?php
$current_page = get_query_var('paged');
$current_page = max( 1, $current_page );
$per_page = 3;
$offset = ( $current_page - 1 ) * $per_page + 1;
$post_list = new WP_Query(array(
'cat' => -15,
'posts_per_page' => $per_page,
'paged' => $current_page,
'offset' => $offset,
'orderby' => 'date',
'order' => 'DESC',
));
if ( $post_list->have_posts() ):
while ( $post_list->have_posts() ):
$post_list->the_post();
?>
<a href="<?php the_permalink(); ?>" <?php post_class('card'); ?>>
<article class="card__content">
<?php the_post_thumbnail('th-card'); ?>
<div class="card__head">
<span class="category"> …Run Code Online (Sandbox Code Playgroud)