[英]Cannot find module '../lib/cli' error when running server
I am trying to run build a small express API. 我正在尝试构建一个小型Express API。 The problem is I am having problems trying to get the server up and running. 问题是我在尝试启动服务器并运行时遇到问题。 When I type npm start I get the following error. 当我输入npm start时,出现以下错误。
> nodemon ./index.js --exec babel-node -e js
module.js:557
throw err;
^
Error: Cannot find module '../lib/cli'
The script I have written in the in that package.json is the following. 我在package.json中编写的脚本如下。
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start":"nodemon ./index.js --exec babel-node -e js"
},
Any help would be appreciated. 任何帮助,将不胜感激。
I needed to reinstall the node_modules. 我需要重新安装node_modules。
cd your_project_folder
rm -rf node_modules
npm install
There can be some issue with the node_modules. node_modules可能存在一些问题。 You must check your node_modules installation globally as well as locally inside project directory. 您必须全局以及在项目目录中本地检查node_modules的安装。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.