Forums

Reset to factory settings

[EDIT: Sorry for the bad title of this post, I was originally going to ask another question but I changed my mind and it's really late on a Friday night - so I'm tired and stupid. Please help.]

If you could answer why this happens then I could sleep easy.

I really need your help since I cannot replicate this issue in any other environment - only on my www.easter.company web app when running live and in production...

subprocess. Call("npm install", shell=True, cwd=app_data['src'])

where app_data['src'] in this instance is equal to /home/eastercompany/Easter/Dev/Int/Easter/clients/eastercompany

returns "install: 1: npm: not found"

from within a web-console it works fine, but when It's called from the API running on "www.easter.company/e-panel" it returns an error message.

I've built a CI/CD Pipeline kind of thing, and when I send a "deploy" command to an API on my "e-panel" app it:

  • successfully updates the backend
  • updates the source code for the frontend
  • fails to call npm install because npm is not found
  • fails to call npm run build because npm is not found
  • reloads the server using your API which is great
  • and then what is deployed is a new backend with the same old front end.

I've tried a million alternatives to that subprocess.call() function, which was originally a "os.system()" function, but that was worse because it wasn't even giving me a good error message to work on.

Node is not pre-installed on PythonAnywhere but follow instructions: https://help.pythonanywhere.com/pages/Node

@fjl

I am aware and I have followed these instructions; I have NPM & Node installed and they are callable from my web console. However, when I call these from within my code, they are not found.

There must be a difference between deployed code and what I can see on the server, no?

Check absolute path to npm with which npm in the console and then use it in subprocess call