1

npm install has successfully worked on every other package I have installed, but for some reason I always get this error on git bash when downloading ejs. I was able to "npm install ejs" successfully on windows power shell. Any ideas on why this only happens when installing ejs on gitbash?

I've tried reinstalling(gitbash, and node). The $path for npm and node is there.

'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN ejsdemo@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ejs@3.0.1 postinstall: `node ./postinstall.js`
npm ERR! Exit status 1
npm ERR!

node is working $ node Welcome to Node.js v13.1.0. Type ".help" for more information.

  • Don't add pictures for text logs. Read how to [format your post](https://stackoverflow.com/editing-help), and update your post accordingly. If there's an error log, put that log (redacted to within reason, of course) [in your post](/help/how-to-ask). Having said that, your log is complaining that `node` does not exist, which usually means it's not in the PATH, and that's really easy to fix (the "how" for which is quite easily found with google/duckduckgo/etc) – Mike 'Pomax' Kamermans Nov 25 '19 at 01:43
  • Thank you for your response, as you could easily see this was my first stack post. the PATH for node exists. I'm able to use node. this error log only happens when I try to install ejs. Do you know what else it can be? – Curious_zunoM Nov 25 '19 at 02:02
  • This is where I go "did you remember to ask over on https://github.com/mde/ejs/issues first"? Because SO is for when you've run out of obvious places to ask, and the official ejs issue tracker is kind of the very first place to ask this question. – Mike 'Pomax' Kamermans Nov 25 '19 at 02:18
  • Did not know that, thank you. – Curious_zunoM Nov 25 '19 at 02:22

1 Answers1

0

You can see a similar error in nodejs/help issue 1989

I have uninstalled and reinstalled nodejs .
This time I have used the nodejs command prompt and was able to install api connect.
Earlier I was using the regular windows command prompt may be that was my mistake.

that was not the mistake.

  • i) Installing Node without selecting the option to set Node path in the environment variables,
  • ii) executing scripts that expects Node in the execution environment without explicitly setting the PATH in conjunction with (i) , led to the problem.

Either select the option to set Node path in the environment while installing (recommended) or explicitly add the it in the command shell whenever you want to run node programs.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I do not think that the problem is with the %path and installations. I am able to use node, and use npm on many other packages. I believe that the error has something to do with the postinstall. I having a lot of trouble figuring out how to fix it since I'm a newbie – Curious_zunoM Nov 25 '19 at 06:12