zoukankan      html  css  js  c++  java
  • Node.js: Python not found exception due to nodesass and nodegyp

    Node.js: Python not found exception due to node-sass and node-gyp

    回答1

    so this happened to me on windows recently. I fix it by following the following steps using a PowerShell with admin privileges:

    1. delete node_modulesfolder
    2. running npm install --global windows-build-tools with administrative privilege. (in my case need restart - and restart without ask!!!)
    3. reinstalling node modules or node-sass with npm install
    This is exactly the right answer. npm install --global windows-build-tools installs Python 2.7, and installs it globally (so you don't have to re-install on a per-project basis). It fixes the "can't install SASS" problem. NOTE: On windows, you must run your npm command prompt as "Administrator".
    – paulsm4
    Nov 22 '18 at 22:14

    回答2

    The error message means that it cannot locate your python executable or binary.

    In many cases, it's installed at c:\python27. if it's not installed yet, you can install it with npm install --global windows-build-tools, which will only work if it hasn't been installed yet.

    Adding it to the environment variables does not always work. A better alternative, is to just set it in the npm config.

    npm config set python c:\python27\python.exe

  • 相关阅读:
    [译]GLUT教程
    [译]GLUT教程
    [译]GLUT教程
    [译]GLUT教程
    [译]GLUT教程
    [译]GLUT教程
    [译]GLUT教程
    表单
    列表、表格与媒体元素
    HTML5基础
  • 原文地址:https://www.cnblogs.com/chucklu/p/15556384.html
Copyright © 2011-2022 走看看