1

I am installing laravel CoreUi Admin template when I ran npm install it gives me build error.

npm ERR! code 1
npm ERR! path D:\laragon_new\www\sms\coreui\node_modules\deasync
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c node ./build.js
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@16.4.0 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Users\B L Praveen\AppData\Local\Programs\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 (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "D:\\nodejs\\node.exe" "D:\\laragon_new\\www\\sms\\coreui\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\laragon_new\www\sms\coreui\node_modules\deasync
npm ERR! gyp ERR! node -v v16.4.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed

I have installed python39 on my system.

I tried from command line I get the same error.

Please let me know right syntax to get the sys.version_info

I have python3 installed

but npm installed node-gyp@3.8.0 which uses legacy python statements

How to run with using node-gyp@latest?

The issue with node-sass using node-gy@3.8.0

enter image description here

B L Praveen
  • 1,812
  • 4
  • 35
  • 60
  • super personal recommendation, you are using windows 10, install WSL and your problems will be solved, never use CMD again, use WSL, google it, it is really simple to install. – matiaslauriti Sep 25 '21 at 19:34
  • I get same error.Is the Pyhton syntax correct?"SyntaxError: invalid syntax" – B L Praveen Sep 26 '21 at 03:44
  • I am looking on google and I cannot find `print "xxx"`, but `print("xxx")`, so I think that is the error. – matiaslauriti Sep 27 '21 at 02:04

1 Answers1

0

I ran npm shrinkwrap

it created npm-shrinkwrap.json

I edited the node-gyp version to 8.0.1

I got the node-gyp latest version from command line node view node-gyp version

Then finally ran npm install

B L Praveen
  • 1,812
  • 4
  • 35
  • 60