1

I have cloned my project from git and when trying to do the npm install, it's not working.

I can't fix any of the errors - for example when trying to fix the core-js error with npm install --save core-js@^3 I still get the same message, that I need to upgrade.

Why is this happening? there were no errors before I cloned this repo?

npm WARN deprecated @babel/polyfill@7.12.1:  This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code 1
npm ERR! path C:\Users\User\Desktop\mydailyprep\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@14.16.1 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (child_process.js:308:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! gyp ERR! System Windows_NT 10.0.17134
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\Desktop\\myapp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\User\Desktop\mydailyprep\node_modules\node-sass
npm ERR! gyp ERR! node -v v14.16.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2021-04-09T10_33_10_047Z-debug.log
Lukas Vis
  • 407
  • 5
  • 14
  • As the [tag:git] text says: *Also, do not use this tag for general programming questions that happen to involve a Git repository.* – torek Apr 09 '21 at 10:44
  • The text in the middle is Python-2 code that has been run by Python-3.9 (where it's invalid); it's not at all clear to me how that came about, though. – torek Apr 09 '21 at 10:46
  • 1
    Does this answer your question? [After `npm install` an error about a syntax error in python appears?](https://stackoverflow.com/a/54059596/1913729) – blex Apr 09 '21 at 10:47

2 Answers2

0

Try :

npm cache clean --force
npm install
Toxy
  • 696
  • 5
  • 9
0

Even I faced same kind of issue... might be this may be helpful to you.. :)

I have created a folder called "projects (Folder Name)" in that I have taken the clone of my project - called "xyz project (projects >> xyz project)"..

now by mistake I tried to install - npm install in "projects folder (parent folder)"..

but node modules have to be installed in "xyz project" (child folder)

So when I have used npm i... in xyz project... then node modules have installed SUCCESSFULLY..

Try this..

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 20 '21 at 07:34