Category : node.js

I’m new to node js, I call my python script from node, and I want to wait until the python script over. what is the simplest way? my code : PythonShell.run(‘public/python/dag.py’, null, function (err,result) { if (err) throw err; console.log(result) }) console.log("amit") my output: "amit" ["hey python"] expected output: ["hey python"] "amit" Source: Python..

Read more

I need to use a python3 script executed by js sever, i dont know how to set the variables like –name on spawn, thats my problem. this is my code on js: var { spawn } = require(‘child_process’); console.log("——————–SART———————"); var path = "/home/usr/Documentos/Proyectos/Repos/test_recurrent.py"; pythonProcess = spawn(‘python3’,[path]); console.log("——————–SPAWN———————"); pythonProcess.stdout.on(‘data’, (data) => { console.log(`stdout: ${data}`); }); pythonProcess.stderr.on(‘data’, ..

Read more

I am trying to execute the command npm install in a project and it gives me this error: $ npm install > [email protected] install C:UsersirodribaDocumentsprojectnode_modulesnode-expat > node-gyp rebuild C:UsersirodribaDocumentsprojectnode_modulesnode-expat>if not defined npm_config_node_gyp (node "C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin….node_modulesnode-gypbinnode-gyp.js" rebuild ) else (node "C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode_modulesnode-gypbinnode-gyp.js" rebuild ) Warning: Missing input files: C:UsersirodribaDocumentsprojectnode_modulesnode-expatbuilddepslibexpat……depslibexpatversion.c Los proyectos de esta soluciĆ³n se van ..

Read more

I’m trying an npm install in a proyect and I recieve this error: C:UsersirodribaDocumentswiposequencenode_modulesiconv>if not defined npm_config_node_gyp (node "C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin….node_modulesnode-gypbinnode-gyp.js" rebuild ) else (node "C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode_modulesnode-gypbinnode-gyp.js" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can’t find Python executable "C:Usersirodriba.windows-build-toolspython27python.exe", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode_modulesnode-gyplibconfigure.js:484:19) ..

Read more