SASS不工作,命令提示在gulp服务期间抛出错误

时间:2016-03-24 06:17:32

标签: css angularjs sass gulp

我正在使用angularjs和gulp构建一个Web应用程序。无论何时,我运行gulp服务,该网站正在工作,但是,CSS无法运行。我在命令提示符中收到以下错误。我试图重新安装node_modules,node.js和gulp。但是,出现相同的错误。

npm WARN excluding symbolic link index.js -> lib/sass.js
npm WARN excluding symbolic link lib\index.js -> sass.js

bufferutil@1.2.1 install C:\Users\User\Desktop\grpkgb\project\node_modules\bufferutil
node-gyp rebuild


C:\Users\User\Desktop\grpkgb\project\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Users\User\Anaconda3\python.EXE" is v3.5.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:475:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\Desktop\grpkgb\project\node_modules\bufferutil
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:bufferutil@1.2.1 bufferutil@1.2.1 install: `node-gyp rebuild`
npm WARN install:bufferutil@1.2.1 Exit status 1

utf-8-validate@1.2.1 install C:\Users\User\Desktop\grpkgb\project\node_modules\utf-8-validate
node-gyp rebuild


C:\Users\User\Desktop\grpkgb\project\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Users\User\Anaconda3\python.EXE" is v3.5.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:475:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\Desktop\grpkgb\project\node_modules\utf-8-validate
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate@1.2.1 Exit status 1
projectFile@0.0.0 C:\Users\User\Desktop\grpkgb\project
+-- bootstrap-sass@3.3.6  extraneous
+-- gulp-sass@2.2.0  extraneous
`-- sass@0.5.0  extraneous

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.9
npm WARN projectFile@0.0.0 No repository field.
npm WARN projectFile@0.0.0 No license field.

1 个答案:

答案 0 :(得分:0)

错误说明了一切

  

gyp ERR! stack错误:Python可执行文件   &#34; C:\用户\用户\ Anaconda3 \ python.EXE&#34;是v3.5.1,不受支持   通过gyp。 gyp ERR! stack您可以将--python开关传递给指向   Python&gt; = v2.5.0&amp; &LT; 3.0.0。

您需要安装适用于Node gyp的Python this版本。

您可以在此处找到Node gyp DOCs以获取更多详细信息