在 Visual Studio Code 中,当我毫无问题地运行
nodemon app
时,我可以看到我的网站在本地端口上运行。
现在我尝试做的是使用 CentOS7 VPS 服务器在我的终端中运行我的
app.js
,它给我一个错误如下:
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node app.js`
/home/gtbiwebroot/gtbiwebappnodejs/node_modules/axios/index.js:1
import axios from './lib/axios.js';
^^^^^
.
.
.
[nodemon] app crashed - waiting for file changes before starting...
我尝试了
Babel
,还有require
声明,npm install for package json
,deleted and reinstalled package.json and node_modules folders
以及互联网上建议的所有内容,但这些解决方案均无效。
我的 NodeJS 版本是
v10.24.1
.