简体   繁体   English

我尝试使用 npm i 安装依赖项,但它不起作用! 帮我

[英]I tried installing the dependencies with npm i, but it doesn't work !! Help me

When I try to install the project dependencies with npm I get this error:当我尝试使用 npm 安装项目依赖项时,出现此错误:

在此处输入图像描述

Anyone could help me?任何人都可以帮助我吗?

Can you provide a sample package.json ?你能提供样品package.json吗? It seems to be a issue with make.好像是make的问题。 What you can do in the mean time you could try deleting the package-lock.json and then do a npm install .与此同时,您可以尝试删除package-lock.json然后执行npm install See if that fixes the issue.看看是否能解决问题。

If it threw that error from 1st time running npm install that's probably not the issue.如果它从第一次运行npm install时抛出该错误,那可能不是问题所在。

One other thing you could try is to make sure you have the build tools installed on your macOS.您可以尝试的另一件事是确保您在 macOS 上安装了构建工具。

xcode-select --install

EDIT:编辑:

  1. Try to delete the library from the cache.尝试从缓存中删除库。
rm -rf ~/LibraryCaches/node-gyp
  1. Delete package-lock.json, /node_modules/ folder, and ~/.node-gyp/ folders.删除 package-lock.json、/node_modules/ 文件夹和 ~/.node-gyp/ 文件夹。
rm package-lock.json && rm -rf node_modules && rm -rf ~/.node-gyp
  1. Rerun重新运行
npm install

You can also check these steps to further debug your issue.您还可以检查这些步骤以进一步调试您的问题。

Hope it helps.希望能帮助到你。

暂无
暂无

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

相关问题 我执行npm取消链接后npm start不起作用 - npm start doesn't work after i do npm unlink 我试图用 fetch 更新我的 ejs 页面,但它不起作用 - i tried to upate my ejs page with fetch but it doesn't work 尝试使用 npm i bcrypt 时 bcrypt 未安装 - bcrypt not installing when tried to using npm i bcrypt 当我在devDependencies中有一个项目时,为什么npm不安装依赖项? - Why isn't npm installing dependencies when I have an item inside devDependencies? Npm脚本不符合我想要的方式 - Npm scripts doesn't work the way I want 我想在 npm 上安装 mechanic,我尝试运行这条线 sudo npm install -g mechanic,但它给了我错误,我不明白这个错误 - I want to install mechanic on npm, I tried to run this line sudo npm install -g mechanic, but it gives me error, I don't understand this error readFileSync无法与我一起使用。 将输入设置为字符串后,我尝试打印输入,但很奇怪 - readFileSync won't work with me. I tried to print the input after setting it to string but was weird 我遇到npm启动问题,有人可以帮我吗? - I'm having npm start problems, can someone help me? “npm start”不起作用尝试了“resmon”但在资源监视器中找不到 cmd.exe - "npm start" doesn't work tried "resmon" but couldn't find cmd.exe in the resource monitor 我试过的每一个 XML 解析器都不适用于这个特定的 XML - Every single XML parser I tried doesn't work with this specific XML
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM