您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

由于node-gyp,Npm无法安装

由于node-gyp,Npm无法安装

我过去也遇到过同样的问题。这是解决方案。您可能需要几次重新启动计算机才能清除所有错误

解:

1. Install Install VC++ Build Tools  2017 and while installing select V140 from the side menu

2. Install Python 2.7, and add it to your PATH

3. npm config set python python2.7 --global

4. npm config set python C:\Python27\python.exe --global

5. npm config set msvs_version 2015 --global

6. set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140


**Note:  If you still face error > most likely the problem is node-sass is not installed**

完成此步骤后,您必须重新启动计算机

7. Install the latest versions of Python

8. As Admin:
$ cd "C:\Program Files\nodejs\node_modules\npm"
$ npm install node-gyp

9. $ npm config set msvs_version 2015 --global

Note: that I have VS 2017, but configuring it as ver 2017 won't work. Not sure why.

    10. As Admin:
$ npm install -g node-sass

And finally, one last check:
$ node-sass -v

希望能帮助到你。

Node 2022/1/1 18:17:23 有654人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶