Tomotoes / HomePage

🎃一个坏掉的番茄个人主页~
https://tomotoes.com
GNU Lesser General Public License v3.0
488 stars 132 forks source link

在安装步骤的时候就出了问题 #3

Open azwnini opened 1 year ago

azwnini commented 1 year ago

git拉取到本地后,执行npm install 的时候出现了问题 我的npm是9.6.4 node是V20.1.0

azwnini commented 1 year ago

https://zhuanlan.zhihu.com/p/336410564 这个网站上也有很多人想来使用这个主页,但是好像都在这个步骤中被劝退,希望博主能有时间修复一下,感激不尽

azwnini commented 1 year ago

这个是报错信息

 npm install
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated svgo@0.7.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /Users/azw/static/HomePage/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /opt/homebrew/Cellar/node/20.1.0/bin/node /Users/azw/static/HomePage/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   '/opt/homebrew/Cellar/node/20.1.0/bin/node',
npm ERR! gyp verb cli   '/Users/azw/static/HomePage/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@20.1.0 | darwin | arm64
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` succeeded python2 /usr/bin/python2
npm ERR! gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.18
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 20.1.0
npm ERR! gyp verb command install [ '20.1.0' ]
npm ERR! gyp verb install input version string "20.1.0"
npm ERR! gyp verb install installing version: 20.1.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 20.1.0
npm ERR! gyp verb build dir attempting to create "build" dir: /Users/azw/static/HomePage/node_modules/node-sass/build
npm ERR! gyp verb build dir "build" dir needed to be created? /Users/azw/static/HomePage/node_modules/node-sass/build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: /Users/azw/static/HomePage/node_modules/node-sass/build/config.gypi
npm ERR! gyp verb config.gypi checking for gypi file: /Users/azw/static/HomePage/node_modules/node-sass/config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: /Users/azw/static/HomePage/node_modules/node-sass/common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "make"
npm ERR! gyp info spawn /usr/bin/python2
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/azw/static/HomePage/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/azw/static/HomePage/node_modules/node-sass/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/azw/static/HomePage/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/azw/.node-gyp/20.1.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/azw/.node-gyp/20.1.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/azw/static/HomePage/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/azw/.node-gyp/20.1.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/azw/static/HomePage/node_modules/node-sass',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
npm ERR!     return gyp_main(args)
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 514, in gyp_main
npm ERR!     options.duplicate_basename_check)
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 130, in Load
npm ERR!     params['parallel'], params['root_targets'])
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2783, in Load
npm ERR!     variables, includes, depth, check, True)
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 399, in LoadTargetBuildFile
npm ERR!     includes, True, check)
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 271, in LoadOneBuildFile
npm ERR!     aux_data, includes, check)
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 308, in LoadBuildFileIncludesIntoDict
npm ERR!     LoadOneBuildFile(include, data, aux_data, None, False, check),
npm ERR!   File "/Users/azw/static/HomePage/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 251, in LoadOneBuildFile
npm ERR!     None)
npm ERR!   File "/Users/azw/.node-gyp/20.1.0/include/node/common.gypi", line 1
npm ERR!     erate ',
npm ERR!            ^
npm ERR! SyntaxError: EOL while scanning string literal
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/azw/static/HomePage/node_modules/node-gyp/lib/configure.js:345:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:511:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Darwin 21.2.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/20.1.0/bin/node" "/Users/azw/static/HomePage/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/azw/static/HomePage/node_modules/node-sass
npm ERR! gyp ERR! node -v v20.1.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: /Users/azw/.npm/_logs/2023-05-15T04_09_49_295Z-debug-0.log
Juskinbo commented 1 year ago

从报错信息看应该是没有正确安装 python2 或者没有将 python2 添加到 PATH,node-sass@4.x 需要 python2 环境且添加到 PATH,可以检查一下。

Drake-Wu commented 1 year ago

https://blog.csdn.net/Youweretrouble/article/details/129799001 是node-sass和系统的nodejs的版本没有对应上。 我用cnpm就没事,先把package.json中的node-sass和gulp-sass删掉,

cnpm install node-sass --save-dev cnpm install gulp-sass --save-dev 再把其他的装好 cnpm install 然后还有个运行时错误 gulpfile.js中第12行改成: const sass = require('gulp-sass')(require('sass')) 然后装个sass cnpm install sass --save-dev 就可以跑起来了。

tsukinuru commented 1 year ago

https://blog.csdn.net/Youweretrouble/article/details/129799001 是node-sass和系统的nodejs的版本没有对应上。 我用cnpm就没有事,先把package.json中的node-sass和gulp - sass摔摔,

cnpm install node-sass --save-dev cnpm install gulp-sass --save-dev 再把其他的安装好 cnpm install 然后还有个运行时错误 gulpfile.js中第12行修改: const sass = require(' gulp-sass')(require('sass')) 然后安装一个sass cnpm install sass --save-dev 就可以跑起来了。

可以的,用cnpm可以跑起来,npm会安装不上,玄学问题,感谢

zzy-life commented 1 year ago

git拉取到本地后,执行npm install 的时候出现了问题 我的npm是9.6.4 node是V20.1.0

4

ClearPlume commented 1 year ago

升级一下依赖就可以了,主要是两个sass

GinGin520 commented 6 months ago

https://blog.csdn.net/Youweretrouble/article/details/129799001

请问有没有升级完可以正确运行的版本呢

Small-BlueFish-hjy commented 3 months ago

https://blog.csdn.net/Youweretrouble/article/details/129799001 是node-sass和系统的nodejs的版本没有对应上。 我用cnpm就没事,先把package.json中的node-sass和gulp-sass删掉,

cnpm install node-sass --save-dev cnpm install gulp-sass --save-dev 再把其他的装好 cnpm install 然后还有个运行时错误 gulpfile.js中第12行改成: const sass = require('gulp-sass')(require('sass')) 然后装个sass cnpm install sass --save-dev 就可以跑起来了。

感谢,顺利解决了!!!

Small-BlueFish-hjy commented 3 months ago

https://blog.csdn.net/Youweretrouble/article/details/129799001 是node-sass和系统的nodejs的版本没有对应上。 我用cnpm就没事,先把package.json中的node-sass和gulp-sass删掉,

cnpm install node-sass --save-dev cnpm install gulp-sass --save-dev 再把其他的装好 cnpm install 然后还有个运行时错误 gulpfile.js中第12行改成: const sass = require('gulp-sass')(require('sass')) 然后装个sass cnpm install sass --save-dev 就可以跑起来了。

感谢,顺利解决了!!!

ImmortalEpic commented 2 months ago

绕过SSH证书验证就行了

xingkongdeweilai commented 1 month ago

额,第一遍也是报没python,再跑一次就不报错了