【发布时间】:2019-10-30 15:26:06
【问题描述】:
index.js:
const port = process.env.PORT || 3000;
服务器包.json:
"start": "node index.js",
"server": "nodemon index.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
客户端包.json:
"proxy": "http://localhost:5000",
我从npm run dev开始
知道问题出在哪里吗?
错误:
Error: Cannot find module '.../index.js'
【问题讨论】:
-
让我们看看你的文件夹结构?现在我要猜测一下,告诉你试试
../../index.js -
文件夹结构是:主文件夹:项目和内部客户端文件夹(用于反应)和 index.js 所在的 src 文件夹(服务器)
-
子路径中有客户端或服务器吗?如果是,您需要在命令定义处运行“cd
&&” -
子路径是什么意思?我不太明白我需要做什么?
-
我会写一个回答,你会明白的,等等...
标签: node.js reactjs concurrently