我正在参与一个节点项目。我使用github作为版本控制器,使用visual studio代码作为文本编辑器。,用于安装
打包器,我输入了命令
npm install -D babel-cli babel-preset-env nodemon
然后终端显示了这个错误。
PS C:\Users\ruwan\Documents\projects\MEANBack> npm install -D babel-cli babel-preset-env nodemon
npm WARN MEANBack@1.0.0 No description
npm WARN MEANBack@1.0.0 No repository field.
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ruwan\AppData\Roaming\npm-cache\_logs\2019-04-11T08_21_08_741Z-debug.log然后,我试图放弃所有的改变,由视觉工作室。这不是成功。我该为此做些什么。
发布于 2021-08-13 13:10:23
在一个非常不同的环境中,我也遇到了类似的问题。我用yarn global add babel-cli解决了这件事。
我正在构建一个基于ubuntu:14.04的码头形象(2014年4月),Docker 18.06.3~se~3-0~ubuntu (2019)和节点14.17.5 (2021年发布)。这是新旧两种奇特的结合。我的Docker引擎分配了10 be的RAM和4个CPU,所以资源不应该是一个问题。
我的Dockerfile包含以下命令:
ENV NODE_VERSION=14.17.5
RUN curl -SL "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" | \
tar xz -C /usr/local --strip-components=1 && \
npm install -g yarn@1.0.2 babel-cli导致一组有趣的错误:
#11 5.898 npm WARN deprecated yarn@1.0.2: It is recommended to install Yarn using the native installation method for your environment. See https://yarnpkg.com/en/docs/install
#11 6.208 /usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js
#11 6.208 /usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js
#11 6.217 + yarn@1.0.2
#11 6.217 added 1 package in 1.339s
#11 10.21 npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
#11 12.49 npm WARN deprecated core-js@2.6.12: core-js@<3.3 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.
#11 15.98 npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
#11 23.90 npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
#11 23.91 npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
#11 32.48 /usr/local/bin/babel -> /usr/local/lib/node_modules/babel-cli/bin/babel.js
#11 32.48 /usr/local/bin/babel-doctor -> /usr/local/lib/node_modules/babel-cli/bin/babel-doctor.js
#11 32.48 /usr/local/bin/babel-external-helpers -> /usr/local/lib/node_modules/babel-cli/bin/babel-external-helpers.js
#11 32.48 /usr/local/bin/babel-node -> /usr/local/lib/node_modules/babel-cli/bin/babel-node.js
#11 32.62
#11 32.62 > core-js@2.6.12 postinstall /usr/local/lib/node_modules/babel-cli/node_modules/core-js
#11 32.62 > node -e "try{require('./postinstall')}catch(e){}"
#11 32.62
#11 33.62 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/babel-cli/node_modules/chokidar/node_modules/fsevents):
#11 33.62 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
#11 33.62
#11 33.76 npm ERR! Maximum call stack size exceeded
#11 33.87
#11 33.87 npm ERR! A complete log of this run can be found in:
#11 33.87 npm ERR! /root/.npm/_logs/2021-08-13T12_31_19_942Z-debug.log在安装阶段包括“最大调用堆栈大小超出”错误。
我的解决办法是使用yarn安装软件包:
ENV NODE_VERSION=14.17.5
RUN curl -SL "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" | \
tar xz -C /usr/local --strip-components=1 && \
npm install -g yarn@1.0.2 && \
yarn global add babel-cli这使得安装可以继续进行,babel可以在全球范围内使用。
https://stackoverflow.com/questions/55628136
复制相似问题