Closed
Description
Today, my node modules have been reset for somewhat reason(idk) and I re-installed it. It worked properly until yesterday, but this error suddenly occurred.
+) I'm using ExpressJS
Error Message
TypeError: PythonShell.run is not a function
at getKeyword (/home/joon/Desktop/server_study/db.js:313:17)
db.js
const PythonShell = require('python-shell');
var pyOptions = {
mode: 'text',
pythonPath: '/usr/bin/python3.5',
pythonOptions: ['-u'],
scriptPath: './python',
args: ['title', 'researcher', 'path_of_txt']
};
...
function pythonTest(cb){
PythonShell.run("x=1;print(x)", null, (err, results)=>{
console.log(results);
});
}
package.json
{
"name": "server_study",
"version": "1.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"body-parser": "^1.18.3",
"curl": "^0.1.4",
"ejs": "^2.6.1",
"express": "^4.16.2",
"express-session": "^1.15.6",
"i18n": "^0.8.3",
"jquery": "^3.3.1",
"jsdom": "^11.10.0",
"multer": "^1.3.0",
"mysql": "^2.16.0",
"nodemailer": "^4.6.8",
"pdf2json": "^1.1.7",
"python-shell": "^1.0.3",
"serve-index": "^1.9.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"private": true
}