npm install apiconnect 在 macOS Catalina (v10.15.7) 上失败
npm install apiconnect fails on macOS Catalina (v10.15.7)
我的 Node.js 软件包 apiconnect
无法安装在我的新 MacBook Pro 上。 Node.js版本是v10.22.1
,NPM版本是6.14.6
,Python3.8.3
我运行以下命令:
sudo npm install -g --unsafe-perm=true --allow-root --loglevel verbose apiconnect
我收到的错误与我在容器 (appmetrics@3.1.3) 中收到的错误类似。来自日志的错误:
61922 silly install appmetrics@3.1.3
61923 info lifecycle appmetrics@3.1.3~install: appmetrics@3.1.3
61924 verbose lifecycle appmetrics@3.1.3~install: unsafe-perm in lifecycle true
61925 verbose lifecycle appmetrics@3.1.3~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/apiconnect/node_modules/appmetrics/node_modules/.bin:/usr/local/lib/node_modules/apiconnect/node_modules/.bin:/usr/local/lib/node_modules/.bin:/Users/steve/opt/anaconda3/bin:/Users/steve/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
61926 verbose lifecycle appmetrics@3.1.3~install: CWD: /usr/local/lib/node_modules/apiconnect/node_modules/appmetrics
61927 silly lifecycle appmetrics@3.1.3~install: Args: [ '-c', 'node extract_all_binaries.js || node-gyp rebuild' ]
61928 silly lifecycle appmetrics@3.1.3~install: Returned: code: 1 signal: null
61929 info lifecycle appmetrics@3.1.3~install: Failed to exec install script
61930 timing action:install Completed in 26347ms
61931 verbose unlock done using /Users/steve/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
61932 timing stage:rollbackFailedOptional Completed in 8528ms
61933 timing stage:runTopLevelLifecycles Completed in 468567ms
61934 verbose stack Error: appmetrics@3.1.3 install: `node extract_all_binaries.js || node-gyp rebuild`
61934 verbose stack Exit status 1
61934 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
61934 verbose stack at EventEmitter.emit (events.js:198:13)
61934 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
61934 verbose stack at ChildProcess.emit (events.js:198:13)
61934 verbose stack at maybeClose (internal/child_process.js:982:16)
61934 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
61935 verbose pkgid appmetrics@3.1.3
61936 verbose cwd /Users/steve
61937 verbose Darwin 19.6.0
61938 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "--unsafe-perm=true" "--allow-root" "--loglevel" "verbose" "apiconnect"
61939 verbose node v10.22.1
61940 verbose npm v6.14.6
61941 error code ELIFECYCLE
61942 error errno 1
61943 error appmetrics@3.1.3 install: `node extract_all_binaries.js || node-gyp rebuild`
61943 error Exit status 1
61944 error Failed at the appmetrics@3.1.3 install script.
61944 error This is probably not a problem with npm. There is likely additional logging output above.
61945 verbose exit [ 1, true ]
这个有用吗?
npm i -g node-gyp@latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js"
node-gyp rebuild
通过更改我的 PATH
环境变量中的目录顺序和 运行 安装为 sudo
并使用 --unsafe-perm=true
和 --allow-root
选项。
用于安装的完整命令是:
sudo npm install -g --unsafe-perm=true --allow-root --loglevel verbose apiconnect
对于PATH
环境变量,anaconda3
Python/Jupyter Notebook包的安装将它们的目录放在路径的前面。通过将路径更改为:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:...
路径中的第一个目录,安装成功。
我的 Node.js 软件包 apiconnect
无法安装在我的新 MacBook Pro 上。 Node.js版本是v10.22.1
,NPM版本是6.14.6
,Python3.8.3
我运行以下命令:
sudo npm install -g --unsafe-perm=true --allow-root --loglevel verbose apiconnect
我收到的错误与我在容器 (appmetrics@3.1.3) 中收到的错误类似。来自日志的错误:
61922 silly install appmetrics@3.1.3
61923 info lifecycle appmetrics@3.1.3~install: appmetrics@3.1.3
61924 verbose lifecycle appmetrics@3.1.3~install: unsafe-perm in lifecycle true
61925 verbose lifecycle appmetrics@3.1.3~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/apiconnect/node_modules/appmetrics/node_modules/.bin:/usr/local/lib/node_modules/apiconnect/node_modules/.bin:/usr/local/lib/node_modules/.bin:/Users/steve/opt/anaconda3/bin:/Users/steve/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
61926 verbose lifecycle appmetrics@3.1.3~install: CWD: /usr/local/lib/node_modules/apiconnect/node_modules/appmetrics
61927 silly lifecycle appmetrics@3.1.3~install: Args: [ '-c', 'node extract_all_binaries.js || node-gyp rebuild' ]
61928 silly lifecycle appmetrics@3.1.3~install: Returned: code: 1 signal: null
61929 info lifecycle appmetrics@3.1.3~install: Failed to exec install script
61930 timing action:install Completed in 26347ms
61931 verbose unlock done using /Users/steve/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
61932 timing stage:rollbackFailedOptional Completed in 8528ms
61933 timing stage:runTopLevelLifecycles Completed in 468567ms
61934 verbose stack Error: appmetrics@3.1.3 install: `node extract_all_binaries.js || node-gyp rebuild`
61934 verbose stack Exit status 1
61934 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
61934 verbose stack at EventEmitter.emit (events.js:198:13)
61934 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
61934 verbose stack at ChildProcess.emit (events.js:198:13)
61934 verbose stack at maybeClose (internal/child_process.js:982:16)
61934 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
61935 verbose pkgid appmetrics@3.1.3
61936 verbose cwd /Users/steve
61937 verbose Darwin 19.6.0
61938 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "--unsafe-perm=true" "--allow-root" "--loglevel" "verbose" "apiconnect"
61939 verbose node v10.22.1
61940 verbose npm v6.14.6
61941 error code ELIFECYCLE
61942 error errno 1
61943 error appmetrics@3.1.3 install: `node extract_all_binaries.js || node-gyp rebuild`
61943 error Exit status 1
61944 error Failed at the appmetrics@3.1.3 install script.
61944 error This is probably not a problem with npm. There is likely additional logging output above.
61945 verbose exit [ 1, true ]
这个有用吗?
npm i -g node-gyp@latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js"
node-gyp rebuild
通过更改我的 PATH
环境变量中的目录顺序和 运行 安装为 sudo
并使用 --unsafe-perm=true
和 --allow-root
选项。
用于安装的完整命令是:
sudo npm install -g --unsafe-perm=true --allow-root --loglevel verbose apiconnect
对于PATH
环境变量,anaconda3
Python/Jupyter Notebook包的安装将它们的目录放在路径的前面。通过将路径更改为:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:...
路径中的第一个目录,安装成功。