ERR_PNPM_NO_SCRIPT_OR_SERVER Missing script start or file server.js
时间: 2023-09-18 20:16:22 浏览: 70
This error message usually appears when trying to run a Node.js application using the command "npm start" or "node app.js", but the application is missing a file called "server.js" or has no script defined in the package.json file.
To fix this error, you should check if the server.js file exists in the application directory and make sure it has the correct script code. If the file is missing, you can create a new one with the following code:
```
const express = require('express');
const app = express();
app.listen(3000, () => {
console.log('Server started on port 3000');
});
```
Then, you need to update the "start" script in the package.json file to point to the new server.js file:
```
"scripts": {
"start": "node server.js"
}
```
If you still encounter the same error message after these steps, try running "npm install" to ensure that all the required dependencies are installed properly.