繁体   English   中英

当我运行 npm 安装时,出现一个巨大的错误日志

[英]When I run npm install, a huge error log appears

我已经下载了这个 github repo( https://github.com/creativetimofficial/vue-black-dashboard ),当我运行npm install时,它会抛出一个巨大的错误我不知道这意味着什么。

我使用基于 Arch 的 linux 发行版。

我读到我需要安装 node-sass 或其他东西,但我仍然收到错误,所以我无法真正安装任何东西

npm 版本:8.19.1

npm ERR! code 1
npm ERR! path /home/pavel/Documents/vue-black-dashboard/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c -- node scripts/build.js
npm ERR! Building: /usr/bin/node /home/pavel/Documents/vue-black-dashboard/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/usr/bin/node',
npm ERR! gyp verb cli   '/home/pavel/Documents/vue-black-dashboard/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@18.8.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` succeeded python /usr/bin/python
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -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: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack 
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:412:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! gyp ERR! System Linux 5.19.6-arch1-1
npm ERR! gyp ERR! command "/usr/bin/node" "/home/pavel/Documents/vue-black-dashboard/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/pavel/Documents/vue-black-dashboard/node_modules/node-sass
npm ERR! gyp ERR! node -v v18.8.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:

查看日志,您可以找到以下行:

npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /home/pavel/Documents/vue-black-dashboard/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }

NPM 尝试使用pyhton2构建node-sass 由于您可能没有python2 ,它尝试使用python代替,但它( python3 )引发语法错误。

在这里查看非常相似的 SO 问题,我想您应该尝试安装 Python 2.7 以构建node-sass

您应该将 Node.js 更新到最新版本。 https://nodejs.org/en/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM