无法在我的项目中安装node

编程入门 行业动态 更新时间:2024-10-17 06:32:19
无法在我的项目中安装node-sass(Unable to install node-sass in my project [closed])

我正在做wes-bos学习节点课程。 当我运行npm start它显示 - 找不到模块node-sass。 当我尝试运行--npm install node-sass --save时,它会给我以下错误。

I am doing wes-bos Learn Node course. When I run npm start it shows - cannot find module node-sass. And when I try to run npm install node-sass --save, it gives me the following errors.

最满意答案

卸载node-sass: npm uninstall node-sass删除package-lock.json ,并清理缓存: npm cache clean --force ,然后执行npm update , npm-install , npm-update 。 然后再次尝试安装节点sass: npm-install node-sass 。

如果这不是单词,请尝试重建node-sass:

npm rebuild node-sass

如果这不起作用,那么我建议删除package-lock.json , node-modules和npm cache文件夹并执行npm install ,以再次安装所有依赖项。 确保你有一个包含所有依赖项的package.json文件。

package-lock.json文件存在一些问题(当package.json更改时它不会更新)如下所述: https : //github.com/npm/npm/issues/16866 “手动触摸package.json可能会使你的package.json与package-lock.json不兼容“执行npm update以更新package-lock.json文件。 完全禁用包锁创建: npm config set package-lock false

Uninstall node-sass: npm uninstall node-sass Delete package-lock.json, and clean the cache: npm cache clean --force, then do npm update, npm install, npm update. then again try to install node sass: npm install node-sass.

If this doesn't work, Try to rebuild node-sass:

npm rebuild node-sass

If that too doesn't work then i suggest to delete package-lock.json, node-modules and npm cache folder and do npm install , to install all your dependencies again. make sure you have a package.json file with all your dependencies listed.

The package-lock.json file has some issues(it doesn't update when package.json changes) as mentioned here:https://github.com/npm/npm/issues/16866 "Touching package.json by hand may make your package.json to be incompatible with package-lock.json". do npm update to update the package-lock.json file. to completely disable package-lock creation: npm config set package-lock false

更多推荐

本文发布于:2023-08-03 14:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390669.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   node

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!