0

whenever I type npm install in my git bash terminal there is an error that says

> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\Bea Beangca\Desktop\phaser\phaser3-project-template\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js

'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: `node lib/post_install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Bea Beangca\AppData\Roaming\npm-cache\_logs\2021-09-08T06_30_15_228Z-debug.log

And when I type ls in my git bash terminal, it will show that I downloaded node_modules

$ ls
LICENSE  README.md  assets/  build/  index.html  node_modules/  package-lock.json  package.json  src/  webpack.config.js

$ npm run start

> phaser3-project-template@1.0.9 start C:\Users\Bea Beangca\Desktop\phaser\phaser3-project-template
> npm run build && webpack-dev-server --port=8000

'npm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phaser3-project-template@1.0.9 start: `npm run build && webpack-dev-server --port=8000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phaser3-project-template@1.0.9 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Bea Beangca\AppData\Roaming\npm-cache\_logs\2021-09-08T06_34_12_381Z-debug.log
winner_joiner
  • 12,173
  • 4
  • 36
  • 61
Biax20
  • 91
  • 7

1 Answers1

0

It looks like your git bash doesn't have node installed. I only think that because it says npm is not recognized as an internal or external command

If I'm correct I believe your solution would be to install either nvm or nodejs. Are you using Windows?

  • Welcome to Stack Overflow! Please phrase this as an explained conditional answer, in order to avoid the impression of asking a clarification question instead of answering (for which a comment should be used instead of an answer, compare https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead ). For example like "If your problem is ... then the solution is to .... because .... ." – Yunnosch Jan 06 '22 at 22:20
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30754409) – Dylan Kerler Jan 11 '22 at 12:53