在 heroku 上更新我的网站不起作用

Updating my website on heroku is not working

我想更改我在 heroku 上托管的 React.JS 网站,我按照以下步骤编辑我的网站:

  1. 运行 git clone "my wesbite git repository link" 在终端上
  2. 然后 运行 heroku login
  3. cd my-cloned-website
  4. 进行了更改
  5. 运行 git add .
  6. 运行 git commit -m "make it better"
  7. 最后 运行 git push origin main

我以前处理过,但从未遇到过这个错误,但我尝试对 package.json 进行更改,我尝试安装最新版本的 node

然后我不断收到以下错误:

编辑后,我想将更改推送到主分支。

-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 16.x...
       Downloading and installing node 16.14.0...
       Using default npm version: 8.3.1
       
-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build
       
-----> Installing dependencies
       Installing node modules
       npm ERR! code 1
       npm ERR! path /tmp/build_5229914f/node_modules/node-sass
       npm ERR! command failed
       npm ERR! command sh -c node scripts/build.js
       npm ERR! Building: /tmp/build_5229914f/.heroku/node/bin/node /tmp/build_5229914f/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
       npm ERR! make: Entering directory '/tmp/build_5229914f/node_modules/node-sass/build'
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -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
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o ../src/libsass/src/ast_fwd_decl.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/backtrace.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/backtrace.o ../src/libsass/src/backtrace.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/check_nesting.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/check_nesting.o ../src/libsass/src/check_nesting.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/color_maps.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/color_maps.o ../src/libsass/src/color_maps.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/eval.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/eval.o ../src/libsass/src/eval.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass.o ../src/libsass/src/sass.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass2scss.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass2scss.o ../src/libsass/src/sass2scss.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_context.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass_context.o ../src/libsass/src/sass_context.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_functions.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass_functions.o ../src/libsass/src/sass_functions.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_util.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass_util.o ../src/libsass/src/sass_util.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_values.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass_values.o ../src/libsass/src/sass_values.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/source_map.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/source_map.o ../src/libsass/src/source_map.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/subset_map.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/subset_map.o ../src/libsass/src/subset_map.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/to_c.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/to_c.o ../src/libsass/src/to_c.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/to_value.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/to_value.o ../src/libsass/src/to_value.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/units.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/units.o ../src/libsass/src/units.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/utf8_string.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/utf8_string.o ../src/libsass/src/utf8_string.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/util.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/util.o ../src/libsass/src/util.cpp
       npm ERR!   g++ '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/values.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/values.o ../src/libsass/src/values.cpp
       npm ERR!   rm -f Release/obj.target/src/sass.a && ar crs Release/obj.target/src/sass.a Release/obj.target/libsass/src/libsass/src/ast.o 
       npm ERR!   rm -rf "Release/sass.a" && cp -af "Release/obj.target/src/sass.a" "Release/sass.a"
       npm ERR!   g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/app/.node-gyp/16.14.0/include/node -I/app/.node-gyp/16.14.0/src -I/app/.node-gyp/16.14.0/deps/openssl/config -I/app/.node-gyp/16.14.0/deps/openssl/openssl/include -I/app/.node-gyp/16.14.0/deps/uv/include -I/app/.node-gyp/16.14.0/deps/zlib -I/app/.node-gyp/16.14.0/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++14 -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
       npm ERR! make: Leaving directory '/tmp/build_5229914f/node_modules/node-sass/build'
       npm ERR! gyp info it worked if it ends with ok
       npm ERR! gyp verb cli [
       npm ERR! gyp verb cli   '/tmp/build_5229914f/.heroku/node/bin/node',
       npm ERR! gyp verb cli   '/tmp/build_5229914f/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@16.14.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` 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: 16.14.0
       npm ERR! gyp verb command install [ '16.14.0' ]
       npm ERR! gyp verb install input version string "16.14.0"
       npm ERR! gyp verb install installing version: 16.14.0
       npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
       npm ERR! gyp verb install version not already installed, continuing with install 16.14.0
       npm ERR! gyp verb ensuring nodedir is created /app/.node-gyp/16.14.0
       npm ERR! gyp verb created nodedir /app/.node-gyp
       npm ERR! gyp http GET https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz
    
       npm ERR! gyp verb extracted file from tarball include/node/openssl/archs/BSD-x86/asm/crypto/include/internal/dso_conf.h
       npm ERR! gyp verb extracted file from tarball include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       Some possible problems:
       
       - Node version not specified in package.json
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

我该怎么做才能解决这个问题?任何帮助,将不胜感激。提前感谢您的宝贵时间。

Node Sass has some very specific version requirements。您需要确保您的 Node.js 版本和您的 Node Sass 版本兼容。

但是你没有告诉 Heroku 你想使用哪个版本的 Node.js 所以它默认为 Node.js 16:

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 16.x...
       Downloading and installing node 16.14.0...
       Using default npm version: 8.3.1

这与您之前使用的版本不同,并且可能与您在本地使用的版本不同:

-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack

在您的 package.jsonspecify the version of Node.js you are using 总是一个好主意。

您有两个选择:

  1. 指定您之前使用和/或正在本地使用的任何版本,因为它应该与您拥有的 Node Sass 版本兼容。

    我猜是版本 14.x:

    {
      "name": "your-app",
      "version": "1.0.0",
      "engines": {
        "node": "14.x"
      }
    }
    

    请注意,在任何给定时间 Heroku only supports a few versions of Node.js 版本 14.x 是当前受支持的最旧版本。它将在某个时候被弃用。

  2. 将您的本地环境升级到Node.js 16 或 17,然后将您正在使用的 Node Sass 版本升级到兼容版本(看起来像 Node 的 6.0+ 版本16 和版本 7.0+ 用于节点 17)。

    在这种情况下,您需要在 package.json.

    中指定版本 16.x17.x

Heroku 的错误消息在底部提出了相同的建议,但细节少得多:

Some possible problems:
       
- Node version not specified in package.json
  https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

最后,我会注意到 Node Sass 未在积极开发中:

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.