终端无法识别nodemon命令

时间:2020-03-28 09:17:37

标签: javascript node.js npm server nodemon

我正在尝试使用nodemon自动重新加载服务器。我已经将其安装在本地并将开始设置为

import UIKit import WebKit class AlertWebPageViewController: UIViewController { @IBOutlet weak var alertVideos: WKWebView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. guard let url = URL(string: "https://www.youtube.com/watch?v=wZl_gUUClCs") else { return } let request = URLRequest(url: url) alertVideos.load(request) } @IBAction func backButton(_ sender: Any) { self.navigationController?.popViewController(animated: true) } } 使用以下代码:

nodemon app.js

它第一次运行良好,但是在关闭系统一次并重新打开我的项目后,它似乎不再正常运行。现在,每次我使用命令"scripts": { "start": "nodemon app.js" }时,它都会引发错误。

错误行是:

nodemon app.js

enter image description here

1 个答案:

答案 0 :(得分:1)

我能解决的最好的解决方案是:

#include <iostream>
using namespace std;
#define MAX 8

template <class T>
class Queue {
private:
    int front, rear;
    T arr[MAX]{}; //This line over here
public:
    Queue(){
        front = rear = -1;
    }
    bool empty();
    bool full();
    void push(T);
    void pop();
    void print();
};

template <typename T>
bool Queue<T>:: empty() {
    return front == -1 && rear == -1;
}

template <typename T>
bool Queue<T>:: full() {
    return (rear + 1) % MAX == front;
}

template <typename T>
void Queue<T>:: push(T data) {
    if(full())
        cout << "Overflow" << endl;

    else {
        if(empty())
            front = rear = 0;
        else {
            rear = (rear + 1) % MAX;
        }
        arr[rear] = data;
    }
}

template <typename T>
void Queue<T>:: pop() {
    if(empty())
        cout << "Underflow" << endl;
    else {
        if(front == rear)
            front = rear = -1;
        else {
            front = (front + 1) % MAX;
        }
    }
}

template <typename T>
void Queue<T>:: print() {
    if(!empty()) {
        int count = (rear + (MAX - front)) % MAX + 1;
        for(auto i = 0; i < count; ++i) {
            int index = (front + i) % MAX;
            cout << arr[index] << " ";
        }
    }
}
int main() {
    Queue<int> qu;
    qu.push(4);
    qu.push(34);
    qu.push(324);
    qu.push(314);
    qu.push(47);
    qu.push(64);
    qu.pop();
    qu.print();
    return 0;
}