【问题标题】:npm ERR A complete log of this run can be found innpm ERR 此运行的完整日志可以在
【发布时间】:2023-03-03 11:47:02
【问题描述】:

我正在看一个关于 sass 的教程,我被困在这部分,我不熟悉 npm、nodejs 和其他东西,所以我知道我应该做什么!?你能看看为什么我不能安装 node-sass 吗?

PS D:\NODE-SASS> npm install node-sass
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "node-sass" under anpm ERR! also called "node-sass". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\bla blabla_25_42_696Z-debug.log
PS D:\NODE-SASS> npm install node-sass
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "node-sass" under a package
npm ERR! also called "node-sass". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

npm ERR! A complete log of this run can be found in:
npm ERR!  c:/bla bla bla

【问题讨论】:

    标签: javascript node.js npm sass


    【解决方案1】:

    这段文字清楚地表明您在package.json 中为您的项目提供了与此包的名称相同的名称。

    也称为“node-sass”。你的项目名称是否相同 npm 错误!作为您要安装的依赖项?

    package.json 中重命名您的项目,并且可能是一个文件夹本身,以免与此包混淆

    【讨论】:

    • 更改name 属性?没问题,除非你想把它变成 npmjs.com 上的一个包并在那里发布。
    【解决方案2】:

    您应该在 package.json 文件中重命名您的项目名称,然后重试。安装要安装的软件包。都应该没问题

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 2021-04-14
    • 1970-01-01
    • 1970-01-01
    • 2022-08-23
    • 1970-01-01
    • 2021-11-22
    • 2019-07-28
    • 1970-01-01
    相关资源
    最近更新 更多