安装节点模块时出错
Getting error while installing node modules
这是错误日志..
5919 error gyp verb check python checking for Python executable "python2" in the PATH
5919 error gyp verb `which` failed Error: not found: python2
5919 error gyp verb `which` failed at getNotFoundError (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:13:12)
5919 error gyp verb `which` failed at F (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:68:19)
5919 error gyp verb `which` failed at E (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:80:29)
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:89:16
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\index.js:42:5
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\windows.js:36:5
5919 error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
5919 error gyp verb `which` failed python2 Error: not found: python2
5919 error gyp verb `which` failed at getNotFoundError (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:13:12)
5919 error gyp verb `which` failed at F (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:68:19)
5919 error gyp verb `which` failed at E (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:80:29)
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:89:16
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\index.js:42:5
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\windows.js:36:5
5919 error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
5919 error gyp verb `which` failed code: 'ENOENT'
5919 error gyp verb `which` failed }
5919 error gyp verb check python checking for Python executable "python" in the PATH
5919 error gyp verb `which` succeeded python C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\python.EXE
5919 error gyp ERR! configure error
5919 error gyp ERR! stack Error: Command failed: C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
5919 error gyp ERR! stack File "<string>", line 1
5919 error gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
5919 error gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5919 error gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
5919 error gyp ERR! stack
5919 error gyp ERR! stack at ChildProcess.exithandler (node:child_process:397:12)
5919 error gyp ERR! stack at ChildProcess.emit (node:events:390:28)
5919 error gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
5919 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
5919 error gyp ERR! System Windows_NT 10.0.19042
5919 error gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
5919 error gyp ERR! cwd C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\node-sass
5919 error gyp ERR! node -v v16.13.0
5919 error gyp ERR! node-gyp -v v3.8.0
5919 error gyp ERR! not ok
5919 error Build failed with error code: 1
5920 verbose exit 1
下载并安装 python2。 Python310 将不起作用,因为它们的要求略有不同(例如带括号的 print: print() )
node-gyp 正在寻找一个 python 工作安装,但在您的 OS.
的 PATH 变量中找不到它
node-gyp
需要安装 python 才能使用。
来自node-gyp-3.8.0
的版本文档
- 您必须安装 Python 2.7
- 您需要安装Windows构建工具
作为附加依赖项。如果你已经安装了python-2.7
,你可以使用以下任一命令配置gyp
node-gyp --python /path/to/python2.7
或
npm config set python /path/to/executable/python2.7
有关详细信息,请查看 documentation here
这是错误日志..
5919 error gyp verb check python checking for Python executable "python2" in the PATH
5919 error gyp verb `which` failed Error: not found: python2
5919 error gyp verb `which` failed at getNotFoundError (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:13:12)
5919 error gyp verb `which` failed at F (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:68:19)
5919 error gyp verb `which` failed at E (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:80:29)
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:89:16
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\index.js:42:5
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\windows.js:36:5
5919 error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
5919 error gyp verb `which` failed python2 Error: not found: python2
5919 error gyp verb `which` failed at getNotFoundError (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:13:12)
5919 error gyp verb `which` failed at F (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:68:19)
5919 error gyp verb `which` failed at E (C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:80:29)
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\which\which.js:89:16
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\index.js:42:5
5919 error gyp verb `which` failed at C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\isexe\windows.js:36:5
5919 error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
5919 error gyp verb `which` failed code: 'ENOENT'
5919 error gyp verb `which` failed }
5919 error gyp verb check python checking for Python executable "python" in the PATH
5919 error gyp verb `which` succeeded python C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\python.EXE
5919 error gyp ERR! configure error
5919 error gyp ERR! stack Error: Command failed: C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
5919 error gyp ERR! stack File "<string>", line 1
5919 error gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
5919 error gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5919 error gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
5919 error gyp ERR! stack
5919 error gyp ERR! stack at ChildProcess.exithandler (node:child_process:397:12)
5919 error gyp ERR! stack at ChildProcess.emit (node:events:390:28)
5919 error gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
5919 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
5919 error gyp ERR! System Windows_NT 10.0.19042
5919 error gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
5919 error gyp ERR! cwd C:\Users\ADMIN\Downloads\DPM\dpm-repository\node_modules\node-sass
5919 error gyp ERR! node -v v16.13.0
5919 error gyp ERR! node-gyp -v v3.8.0
5919 error gyp ERR! not ok
5919 error Build failed with error code: 1
5920 verbose exit 1
下载并安装 python2。 Python310 将不起作用,因为它们的要求略有不同(例如带括号的 print: print() )
node-gyp 正在寻找一个 python 工作安装,但在您的 OS.
的 PATH 变量中找不到它node-gyp
需要安装 python 才能使用。
来自node-gyp-3.8.0
- 您必须安装 Python 2.7
- 您需要安装Windows构建工具
作为附加依赖项。如果你已经安装了python-2.7
,你可以使用以下任一命令配置gyp
node-gyp --python /path/to/python2.7
或
npm config set python /path/to/executable/python2.7
有关详细信息,请查看 documentation here