【发布时间】:2021-11-18 13:59:20
【问题描述】:
我在运行 npm install 时正在安装 laravel CoreUi 管理模板,它给了我构建错误。
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
我已经在我的系统上安装了 python39。
我从命令行尝试了同样的错误。
请告诉我获取 sys.version_info 的正确语法
我已经安装了 python3
但是 npm 安装了 node-gyp@3.8.0,它使用了遗留的 python 语句
如何使用 node-gyp@latest 运行?
node-sass 使用 node-gy@3.8.0 的问题
【问题讨论】:
-
超级个人推荐,你用的是windows 10,安装WSL你的问题就解决了,再也不用CMD了,用WSL,google一下,安装真的很简单。
-
我得到同样的错误。Pyhton 语法是否正确?"SyntaxError: invalid syntax"
-
我在google上找不到
print "xxx",但是print("xxx"),所以我认为这是错误的。