简体   繁体   English

尝试安装 @babel/preset-env 时出错

[英]error trying to install @babel/preset-env

i am trying to install @babel/preset-env in node and i am getting the following question我正在尝试在节点中安装@babel/preset-env,我收到以下问题

npm install @babel/preset-env --save-dev
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-PMnY0yhKljgjrP3jQNP5C9slQM//bCLO4ZRr9gmo+2mLkVhCIxhT3A9grgblgLXmOPVd6GFzeIEA6/0g99cxDA== integrity checksum failed when
using sha512: wanted sha512-PMnY0yhKljgjrP3jQNP5C9slQM//bCLO4ZRr9gmo+2mLkVhCIxhT3A9grgblgLXmOPVd6GFzeIEA6/0g99cxDA== but got sha512-IU+YnDh7WJASsz892TYz1eQ+vaEypoAPLmu6DO2Uw2NZzfl/F2ypEL3xrEiIXLU8Buok1TujSujt3bLMmUmysg==. (34788 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code EINTEGRITY
npm ERR! errno EINTEGRITY
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/@babel%2fplugin-transform-member-expression-literals: Integrity verification failed for sha512-PMnY0yhKljgjrP3jQNP5C9slQM//bCLO4ZRr9gmo+2mLkVhCIxhT3A9grgblgLXmOPVd6GFzeIEA6/0g99cxDA== (C:\Users\PRO\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\3c\c9\d8d3284a963823acfde340d3f90bdb2540cfff6c22cee1946bf609a8fb698b915842231853dc0f60ae06e580b5e638f55de86173788100ebfd20f7d7310c)
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\PRO\AppData\Roaming\npm-cache\_logs\2019-10-18T22_56_31_231Z-debug.log

try this one of these solutions试试这些解决方案之一

  1. npm cache verify --force
  2. delete packages-lock.json删除packages-lock.json
  3. npm cache clean --force
  4. delete node_modules删除node_modules

Usually, this means your local npm cache or your package-lock.json has been corrupted, causing of @babel/preset-env 's integrity hash from the npm registry to be different from what you have in your package-lock.json . Usually, this means your local npm cache or your package-lock.json has been corrupted, causing of @babel/preset-env 's integrity hash from the npm registry to be different from what you have in your package-lock.json . I'd do these steps in this order.我会按此顺序执行这些步骤。

  1. rm -rf node_modules
  2. rm package-lock.json
  3. npm cache clean -f
  4. npm cache verify -f
  5. npm i

This should remove any cached data you have and force npm to hit the registry for fresh package data and regenerate your package-lock.json to use the updated integrity hash. This should remove any cached data you have and force npm to hit the registry for fresh package data and regenerate your package-lock.json to use the updated integrity hash.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试运行 vue 项目但错误:找不到模块'@vue/cli-plugin-babel' 我安装了依赖项 npm install @babel/core @babel/preset-env - Trying to run vue project but Error: Cannot find module '@vue/cli-plugin-babel' I installed the dependency npm install @babel/core @babel/preset-env 模块构建失败找不到模块'@babel/preset-env' - Module build failed Cannot find module '@babel/preset-env' @babel/preset-env 版本 7 未转换 null-coalescing 运算符 - @babel/preset-env version 7 not transforming the null-coalescing operator 在节点应用程序中使用 babel/preset-env 启用扩展运算符 - Enable spread operator using babel/preset-env in node application 无法使用 @babel/preset-env 运行 node.js 文件 - Unable to run a node.js file with @babel/preset-env 在小型节点项目上使用带有 preset-env 的 babel,无法将 import/export 语句转换为 commonjs - Using babel with preset-env on a small node project, unable to convert import/export statements to commonjs 如何在package.json文件中配置babel / preset-env? - How do I configure my babel/preset-env in my package.json file? Babel preset-env 未加载节点目标的顶级等待语法 - Babel preset-env not loading top level await syntax for node target Babel Preset ENV问题 - Babel Preset ENV issues babel-preset-es2015错误安装 - babel-preset-es2015 error install
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM