由于macOS Big Sur升级而无法再安装npm软件包 [英] Can't install npm packages anymore due to macOS Big Sur upgrade

查看:170
本文介绍了由于macOS Big Sur升级而无法再安装npm软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到macOS Big Sur后,我无法使用早于7的npm进行 npm install (因此npm v7很好).每当我在干净的项目文件夹(没有node_modules文件夹和package-lock.json文件)上收到错误消息超出最大调用堆栈大小时.

After upgrade to macOS Big Sur I can't do npm install with npm older then 7 (so npm v7 is fine). Anytime I'm getting the error message Maximum call stack size exceeded upon clean project folder (without the node_modules folder and package-lock.json file).

我受约束使用

ProductName:    macOS
ProductVersion: 11.0.1
BuildVersion:   20B50
Darwin: 20.1.0
nodejs v14.15.1
npm version 6.14.8

我尝试过:

npm缓存清理--force

npm重建

通过Homebrew,nvm手动安装Node,并将npm降级为各种较低版本.

Install Node manually, by Homebrew, by nvm and also downgrade npm to various lower versions.

重新安装Homebrew,以获取升级到Big Sur之前使用的新背景.

Reinstall Homebrew to get fresh background as it was used before upgrade to Big Sur.

重新安装xcode命令行工具.

Reinstall xcode command-line tools.

运行节点并在Docker容器ubuntu:focal中映射项目.

Run the node and map the project in the docker container ubuntu:focal.

通过 npm install --loglevel verbose 耦合输出的最后几行:

Couple last lines of the output return by npm install --loglevel verbose:

npm http fetch GET 200 https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz 23ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz 15ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz 14ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 51352ms
npm timing stage:loadIdealTree Completed in 51653ms
npm timing stage:generateActionsToTake Completed in 225ms
npm verb correctMkdir /Users/dominikjelinek/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /Users/dominikjelinek/.npm/_locks/staging-a03ae73070af7d1f.lock for /Users/dominikjelinek/home/ccb-survey/survey/components/node_modules/.staging
npm timing audit submit Completed in 931ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 931ms
npm timing audit body Completed in 3ms
npm timing action:extract Completed in 7997ms
npm timing action:finalize Completed in 91317ms
npm verb unlock done using /Users/dominikjelinek/.npm/_locks/staging-a03ae73070af7d1f.lock for /Users/dominikjelinek/home/ccb-survey/survey/components/node_modules/.staging
npm timing stage:rollbackFailedOptional Completed in 2ms
npm timing stage:runTopLevelLifecycles Completed in 156352ms
npm WARN react-plotly.js@2.5.1 requires a peer of plotly.js@>1.34.0 but none is installed. You must install peer dependencies yourself.

npm verb stack RangeError: Maximum call stack size exceeded
npm verb stack     at RegExp.test (<anonymous>)
npm verb stack     at isDepOptional (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:432:45)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:441:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb stack     at failedDependency (/Users/dominikjelinek/.nvm/versions/node/v14.15.1/lib/node_modules/npm/lib/install/deps.js:457:9)
npm verb cwd /Users/dominikjelinek/home/ccb-survey/survey/components
npm verb Darwin 20.1.0
npm verb argv "/Users/dominikjelinek/.nvm/versions/node/v14.15.1/bin/node" "/Users/dominikjelinek/.nvm/versions/node/v14.15.1/bin/npm" "install" "--loglevel" "verbose"
npm verb node v14.15.1
npm verb npm  v6.14.8
npm ERR! Maximum call stack size exceeded

更新1

Apple发布了新的系统升级,但无济于事.产品版本:11.1

Apple released new system upgrade, what didn't help. ProductVersion: 11.1

我认为这不是权限问题,因为我将所有 chmod -R 777项目的项目都设置为777.

I don't think that it is the permissions issue as I set the project to 777 for all chmod -R 777 project.

据我所知,我的队友在Big Sur上运行npm v6很好.

As far as I know my mates are running npm v6 on Big Sur fine.

在docker容器中,我将项目从映射的文件夹复制到docker容器中的其他文件夹,并且 npm install 可以按预期工作.

In the docker container, I copied the project from the mapped folder to some other folder in the docker container and npm install is working as expected.

在VirtualBox中运行的Windows 10也会发生同样的情况,其中npm在共享文件夹上不起作用,但是在将项目复制到VirtualBox Windows计算机中的某些内部文件夹后才起作用.

Same is happening for Windows 10 running in the VirtualBox, where npm is not working upon shared folder, but works after copy the project to some inner folder in the VirtualBox Windows machine.

npm cli问题跟踪中提出了一个问题.

docker问题跟踪中提出了一个问题.

更新2

我试图在Mac机器上创建新用户以部分刷新,我按照此处所述安装了nvm并使用npm v6.14.10运行 nvm install v14.15.4 .

I tried to create new user on my mac machine to start partially fresh, I installed nvm as described here and ran nvm install v14.15.4 with npm v6.14.10.

还是同样的问题.

推荐答案

在我的情况下,谢谢@Flowkap,所有问题:

In my case, thank you @Flowkap, all issues:

  1. 提到 npm install
  2. 睡眠超过24小时后,双机重新启动
  3. 在构建过程中使用SentryWebpackPlugin时出错
  4. 我提出的
  5. 本地git存储库损坏问题以及
  1. mentioned npm install
  2. double machine reboot after sleep of more then 24 hours
  3. error when using SentryWebpackPlugin during the build process
  4. local git repository corruption issue I raised as well

所有问题都可以通过删除趋势科技安全性来解决

这篇关于由于macOS Big Sur升级而无法再安装npm软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆