按照文档设置成14.21.3
npm install 直接报一堆错误
~/works/wodeshangcheng/template/wodeshangcheng_pc
node -v
v14.21.3
~/works/wodeshangcheng/template/wodeshangcheng_pc
npm -v
6.14.18
~/works/wodeshangcheng/template/wodeshangcheng_pc
npm install
npm WARN lifecycle The node binary used for scripts is /Applications/ServBay/script/alias/node but npm is using /Applications/ServBay/package/node/14/14.21.3/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> [email protected] install /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/element-themex/node_modules/fsevents
> node install.js
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../../../nan/nan.h:56:
In file included from /Users/ado/Library/Caches/node-gyp/14.21.3/include/node/node.h:67:
/Users/ado/Library/Caches/node-gyp/14.21.3/include/node/v8.h:22:10: fatal error: 'memory' file not found
22 | #include <memory>
| ^~~~~~~~
1 error generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Applications/ServBay/package/node/14/14.21.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Darwin 24.4.0
gyp ERR! command "/Applications/ServBay/package/node/14/14.21.3/bin/node" "/Applications/ServBay/package/node/14/14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/element-themex/node_modules/fsevents
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok
> [email protected] install /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../../../nan/nan.h:56:
In file included from /Users/ado/Library/Caches/node-gyp/14.21.3/include/node/node.h:67:
/Users/ado/Library/Caches/node-gyp/14.21.3/include/node/v8.h:22:10: fatal error: 'memory' file not found
22 | #include <memory>
| ^~~~~~~~
1 error generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Applications/ServBay/package/node/14/14.21.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Darwin 24.4.0
gyp ERR! command "/Applications/ServBay/package/node/14/14.21.3/bin/node" "/Applications/ServBay/package/node/14/14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/watchpack-chokidar2/node_modules/fsevents
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok
> [email protected] install /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://npm.taobao.org/mirrors/node-sass/v4.14.1/darwin-arm64-83_binding.node
Cannot download "https://npm.taobao.org/mirrors/node-sass/v4.14.1/darwin-arm64-83_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> [email protected] postinstall /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> [email protected] postinstall /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
> [email protected] postinstall /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/swiper
> node -e "console.log('\u001b[35m\u001b[1mLove Swiper? Support Vladimir\'s work by donating or pledging on patreon:\u001b[22m\u001b[39m\n > \u001b[32mhttps://patreon.com/vladimirkharlampidi\u001b[0m\n')"
Love Swiper? Support Vladimir's work by donating or pledging on patreon:
> https://patreon.com/vladimirkharlampidi
> [email protected] postinstall /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass
> node scripts/build.js
Building: /Applications/ServBay/package/node/14/14.21.3/bin/node /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/Applications/ServBay/package/node/14/14.21.3/bin/node',
gyp verb cli '/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb download using dist-url https://npmmirror.com/dist
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /Applications/ServBay/bin/python2
gyp verb check python version `/Applications/ServBay/bin/python2 -c "import sys; print "2.7.18
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 14.21.3
gyp verb command install [ '14.21.3' ]
gyp verb download using dist-url https://npmmirror.com/dist
gyp verb install input version string "14.21.3"
gyp verb install installing version: 14.21.3
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 14.21.3
gyp verb build dir attempting to create "build" dir: /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /Applications/ServBay/bin/python2
gyp info spawn args [
gyp info spawn args '/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/ado/.node-gyp/14.21.3/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/ado/.node-gyp/14.21.3',
gyp info spawn args '-Dnode_gyp_dir=/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/ado/.node-gyp/14.21.3/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb download using dist-url https://npmmirror.com/dist
gyp verb build type Release
gyp verb architecture arm64
gyp verb node dev dir /Users/ado/.node-gyp/14.21.3
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/Users/ado/.node-gyp/14.21.3/include/node -I/Users/ado/.node-gyp/14.21.3/src -I/Users/ado/.node-gyp/14.21.3/deps/openssl/config -I/Users/ado/.node-gyp/14.21.3/deps/openssl/openssl/include -I/Users/ado/.node-gyp/14.21.3/deps/uv/include -I/Users/ado/.node-gyp/14.21.3/deps/zlib -I/Users/ado/.node-gyp/14.21.3/deps/v8/include -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
In file included from ../src/libsass/src/ast.cpp:1:
../src/libsass/src/sass.hpp:49:10: fatal error: 'string' file not found
49 | #include <string>
| ^~~~~~~~
1 error generated.
make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Darwin 24.4.0
gyp ERR! command "/Applications/ServBay/package/node/14/14.21.3/bin/node" "/Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/ado/works/wodeshangcheng/template/wodeshangcheng_pc/node_modules/node-sass
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Applications/MxSrvs/cache/nodejs/_logs/2025-05-10T11_06_52_700Z-debug.log