mac与nodejs升级后:npm8安装git+https://github.com/包报错
Author:zhoulujun Date:
今天升级了电脑了,发现原来的项目git clone 下来无法npm i 安装node_modules包了。
看到了 npm WARN old lockfile,以为是package.lock.json,后面发现并不是这么回事。
在看了包版本的兼容问题,还是出现了这个问题。
最后定位在,如果包是 git+https://github.com/ 链接,就会报这个错。
通过google搜索,找到了答案,再次记一下
删除 CommandLineTools
sudo rm -rf /Library/Developer/CommandLineTools
一定要超管权限,不然无法删除
ls /Library/Developer/
查看包是否还存在,不存在了,继续安装
sudo xcode-select --install
会弹出安装界面,然后点击安装即可。
但是,还是无法解决此问题。
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/zhoulujun.cn/.nvm/versions/node/v16.13.0/bin/node /Users/zhoulujun.cn/.nvm/versions/node/v16.13.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/zhoulujun.cn/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm ERR! npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile This is a one-time fix-up, please be patient...
npm ERR! npm WARN old lockfile
npm ERR! npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm ERR! npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm ERR! npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm ERR! npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated [email protected]: this library is no longer supported
npm ERR! npm WARN deprecated [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
npm ERR! npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! npm WARN deprecated [email protected]: use String.prototype.padStart()
npm ERR! npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm ERR! npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm ERR! npm WARN deprecated [email protected]: 3.x is no longer supported
npm ERR! npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm ERR! npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm ERR! npm WARN deprecated [email protected]: 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 ERR! npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm ERR! npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm ERR! npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm ERR! npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! npm WARN deprecated [email protected]: core-js@<3.4 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. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/zhoulujun.cn/.npm/_cacache/tmp/git-clone20WbyE/node_modules/node-sass
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node scripts/build.js
npm ERR! npm ERR! Building: /Users/zhoulujun.cn/.nvm/versions/node/v16.13.0/bin/node /Users/zhoulujun.cn/.npm/_cacache/tmp/git-clone20WbyE/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! npm ERR! 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_GLIBCXX_USE_CXX11_ABI=1' '-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/zhoulujun.cn/.node-gyp/16.13.0/include/node -I/Users/zhoulujun.cn/.node-gyp/16.13.0/src -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/openssl/config -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/openssl/openssl/include -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/uv/include -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/zlib -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/v8/include -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -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
npm ERR! npm ERR! rm -f Release/sass.a && ./gyp-mac-tool filter-libtool libtool -static -o Release/sass.a Release/obj.target/libsass/src/libsass/src/ast.o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o Release/obj.target/libsass/src/libsass/src/backtrace.o Release/obj.target/libsass/src/libsass/src/base64vlq.o Release/obj.target/libsass/src/libsass/src/bind.o Release/obj.target/libsass/src/libsass/src/cencode.o Release/obj.target/libsass/src/libsass/src/check_nesting.o Release/obj.target/libsass/src/libsass/src/color_maps.o Release/obj.target/libsass/src/libsass/src/constants.o Release/obj.target/libsass/src/libsass/src/context.o Release/obj.target/libsass/src/libsass/src/cssize.o Release/obj.target/libsass/src/libsass/src/emitter.o Release/obj.target/libsass/src/libsass/src/environment.o Release/obj.target/libsass/src/libsass/src/error_handling.o Release/obj.target/libsass/src/libsass/src/eval.o Release/obj.target/libsass/src/libsass/src/expand.o Release/obj.target/libsass/src/libsass/src/extend.o Release/obj.target/libsass/src/libsass/src/file.o Release/obj.target/libsass/src/libsass/src/functions.o Release/obj.target/libsass/src/libsass/src/inspect.o Release/obj.target/libsass/src/libsass/src/json.o Release/obj.target/libsass/src/libsass/src/lexer.o Release/obj.target/libsass/src/libsass/src/listize.o Release/obj.target/libsass/src/libsass/src/memory/SharedPtr.o Release/obj.target/libsass/src/libsass/src/node.o Release/obj.target/libsass/src/libsass/src/operators.o Release/obj.target/libsass/src/libsass/src/output.o Release/obj.target/libsass/src/libsass/src/parser.o Release/obj.target/libsass/src/libsass/src/plugins.o Release/obj.target/libsass/src/libsass/src/position.o Release/obj.target/libsass/src/libsass/src/prelexer.o Release/obj.target/libsass/src/libsass/src/remove_placeholders.o Release/obj.target/libsass/src/libsass/src/sass.o Release/obj.target/libsass/src/libsass/src/sass2scss.o Release/obj.target/libsass/src/libsass/src/sass_context.o Release/obj.target/libsass/src/libsass/src/sass_functions.o Release/obj.target/libsass/src/libsass/src/sass_util.o Release/obj.target/libsass/src/libsass/src/sass_values.o Release/obj.target/libsass/src/libsass/src/source_map.o Release/obj.target/libsass/src/libsass/src/subset_map.o Release/obj.target/libsass/src/libsass/src/to_c.o Release/obj.target/libsass/src/libsass/src/to_value.o Release/obj.target/libsass/src/libsass/src/units.o Release/obj.target/libsass/src/libsass/src/utf8_string.o Release/obj.target/libsass/src/libsass/src/util.o Release/obj.target/libsass/src/libsass/src/values.o
// 省略n行
npm ERR! npm ERR! c++ '-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_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/zhoulujun.cn/.node-gyp/16.13.0/include/node -I/Users/zhoulujun.cn/.node-gyp/16.13.0/src -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/openssl/config -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/openssl/openssl/include -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/uv/include -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/zlib -I/Users/zhoulujun.cn/.node-gyp/16.13.0/deps/v8/include -I../../nan -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -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! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp verb cli [
npm ERR! npm ERR! gyp verb cli '/Users/zhoulujun.cn/.nvm/versions/node/v16.13.0/bin/node',
npm ERR! npm ERR! gyp verb cli '/Users/zhoulujun.cn/.npm/_cacache/tmp/git-clone20WbyE/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! npm ERR! gyp verb cli 'rebuild',
npm ERR! npm ERR! gyp verb cli '--verbose',
npm ERR! npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! npm ERR! gyp verb cli '--libsass_library='
npm ERR! npm ERR! gyp verb cli ]
npm ERR! npm ERR! gyp info using [email protected]
npm ERR! npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! npm ERR! gyp verb command rebuild []
npm ERR! npm ERR! gyp verb command clean []
npm ERR! npm ERR! gyp verb clean removing "build" directory
npm ERR! npm ERR! gyp verb command configure []
npm ERR! npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! npm ERR! gyp verb `which` succeeded python2 /usr/bin/python2
npm ERR! npm ERR! gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.18
npm ERR! npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.13.0
npm ERR! npm ERR! gyp verb command install [ '16.13.0' ]
npm ERR! npm ERR! gyp verb install input version string "16.13.0"
npm ERR! npm ERR! gyp verb install installing version: 16.13.0
npm ERR! npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! npm ERR! gyp verb got "installVersion" 9
npm ERR! npm ERR! gyp verb needs "installVersion" 9
npm ERR! npm ERR! gyp verb install version is good
npm ERR! npm ERR! gyp verb get node dir target node version installed: 16.13.0
npm ERR! npm ERR! gyp verb build dir attempting to create "build" dir: /Users/zhoulujun.cn/.npm/_cacache/tmp/git-clone20WbyE/node_modules/node-sass/build
npm ERR! npm ERR! gyp verb build dir "build" dir needed to be created? /Users/zhoulujun.cn/.npm/_cacache/tmp/git-clone20WbyE/node_modules/node-sass/build
npm ERR! npm ERR! gyp verb build/config.gypi creating config file
npm ERR! npm ERR! gyp verb build/config.gypi writing out config file: /Users/zhoulujun.cn/.npm/_cacache/tmp/git-clone20WbyE/node_modules/node-sass/build/config.gypi
npm ERR! npm ERR! (node:35459) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
转载本站文章《mac与nodejs升级后:npm8安装git+https://github.com/包报错》,
请注明出处:https://www.zhoulujun.cn/html/webfront/ECMAScript/nodejs/8750.html