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

前端 未结 12 1340
余生分开走
余生分开走 2020-12-04 15:22

Suddenly in one of my jenkins environment build has started failing, while in local machine it seems to be working fine as i have python installed,

From the logs i w

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 15:38

    My machine is Windows 10, I've faced similar problems while tried to compile SASS using node-sass package. My node version is v10.16.3 and npm version is 6.9.0

    The way that I resolved the problem:

    1. At first delete package-lock.json file and node_modules/ folder.
    2. Open Windows PowerShell as Administrator.
    3. Run the command npm i -g node-sass.
    4. After that, go to the project folder and run npm install
    5. And finally, run the SASS compiling script, in my case, it is npm run build:css

    And it works!!

提交回复
热议问题