win7 install node-sass出错,提示not found: python2

  • 构建vue.js项目,下载依赖的node-sass模块。但不管npm install还是单独npm install node-sass都报找不到python的错误。

$ npm install

npm WARN prefer global node-gyp@3.6.0 should be installed with -g

> node-sass@4.5.2 install E:\workspace_vscode\yijianyiv1\node_modules\node-sass

> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5 .2/win32-x64-48_binding.node

Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.2/win3 2-x64-48_binding.node":

connect ETIMEDOUT 54.231.72.83:443

Timed out whilst downloading the prebuilt binary

Hint: If github.com is not accessible in your location

try setting a proxy via HTTP_PROXY, e.g.

export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

npm config set proxy http://example.com:8080

> node-sass@4.5.2 postinstall E:\workspace_vscode\yijianyiv1\node_modules\node-sass

> node scripts/build.js

Building: D:\nodejs\node.exe E:\workspace_vscode\yijianyiv1\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_l dflags= --libsass_library=

gyp info it worked if it ends with ok

gyp verb cli [ 'D:\\nodejs\\node.exe',

gyp verb cli 'E:\\workspace_vscode\\yijianyiv1\\node_modules\\node-gyp\\bin\\node-gyp.js',

gyp verb cli 'rebuild',

gyp verb cli '--verbose',

gyp verb cli '--libsass_ext=',

gyp verb cli '--libsass_cflags=',

gyp verb cli '--libsass_ldflags=',

gyp verb cli '--libsass_library=' ]

gyp info using node-gyp@3.6.0

gyp info using node@6.9.5 | win32 | x64

gyp verb command rebuild []

gyp verb command clean []

gyp verb clean removing "build" directory

gyp verb command configure []

gyp verb check python checking for Python executable "python2" in the PATH

gyp verb `which` failed Error: not found: python2

gyp verb `which` failed at getNotFoundError (E:\workspace_vscode\yijianyiv1\ node_modules\which\which.js:13:12)

gyp verb `which` failed at F (E:\workspace_vscode\yijianyiv1\node_modules\which\which.js:68:19)

gyp verb `which` failed at E (E:\workspace_vscode\yijianyiv1\node_modules\which\which.js:80:29)

gyp verb `which` failed at E:\workspace_vscode\yijianyiv1\node_modules\which\which.js:89:16

gyp verb `which` failed at E:\workspace_vscode\yijianyiv1\node_modules\isexe\index.js:42:5

gyp verb `which` failed at E:\workspace_vscode\yijianyiv1\node_modules\isexe\windows.js:36:5

gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15)

gyp verb `which` failed python2 { Error: not found: python2

gyp verb `which` failed at getNotFoundError (E:\workspace_vscode\yijianyiv1\node_modules\which\which.js:13:12)

gyp verb `which` failed at F (E:\workspace_vscode\yijianyiv1\node_modules\which\which.js:68:19)

gyp verb `which` failed at E (E:\workspace_vscode\yijianyiv1\node_modules\which\which.js:80:29)

gyp verb `which` failed at E:\workspace_vscode\yijianyiv1\node_modules\which\which.js:89:16

gyp verb `which` failed at E:\workspace_vscode\yijianyiv1\node_modules\isexe\index.js:42:5

gyp verb `which` failed at E:\workspace_vscode\yijianyiv1\node_modules\isexe\windows.js:36:5

gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOENT' }

gyp verb check python checking for Python executable "python" in the PATH

gyp verb `which` succeeded python D:\Python\python.EXE

gyp verb check python version `D:\Python\python.EXE -c "import platform; print(platform.python_version());"` returned: "3.6.1\r\n"

gyp verb could not find "D:\Python\python.EXE". checking python launcher

gyp verb could not find "D:\Python\python.EXE". guessing location

gyp verb ensuring that file exists: C:\Python27\python.exe

gyp ERR! configure error

gyp ERR! stack Error: Can't find Python executable "D:\Python\python.EXE", you can set the PYTHON env variable.

gyp ERR! stack at Object.failNoPython (E:\workspace_vscode\yijianyiv1\node_modules\node-gyp\lib\configure.js:482:19)

gyp ERR! stack at Object.<anonymous> (E:\workspace_vscode\yijianyiv1\node_modules\node-gyp\lib\configure.js:508:16)

gyp ERR! stack at E:\workspace_vscode\yijianyiv1\node_modules\graceful-fs\polyfills.js:284:29

gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)

gyp ERR! System Windows_NT 6.1.7601

gyp ERR! command "D:\\nodejs\\node.exe" "E:\\workspace_vscode\\yijianyiv1\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--l ibsass_cflags=" "--libsass_ldflags=" "--libsass_library="

gyp ERR! cwd E:\workspace_vscode\yijianyiv1\node_modules\node-sass

gyp ERR! node -v v6.9.5

gyp ERR! node-gyp -v v3.6.0

gyp ERR! not ok

Build failed with error code: 1

yijianyiv1@1.0.0 E:\workspace_vscode\yijianyiv1

+-- autoprefixer@6.7.7

| +-- browserslist@1.7.7

| | `-- electron-to-chromium@1.3.3

| +-- caniuse-db@1.0.30000653

| +-- normalize-range@0.1.2

| +-- num2fraction@1.2.2

| +-- postcss@5.2.17

| | `-- js-base64@2.1.9

| `-- postcss-value-parser@3.3.0

+-- babel-core@6.24.1

| +-- babel-code-frame@6.22.0

| | +-- esutils@2.0.2

| | `-- js-tokens@3.0.1

| +-- babel-generator@6.24.1

| | +-- detect-indent@4.0.0

| | | `-- repeating@2.0.1

| | | `-- is-finite@1.0.2

| | +-- jsesc@1.3.0

| | `-- trim-right@1.0.1

| +-- babel-helpers@6.24.1

| +-- babel-messages@6.23.0

| +-- babel-runtime@6.23.0

| | `-- regenerator-runtime@0.10.3

| +-- babel-template@6.24.1

| +-- babel-traverse@6.24.1

| | `-- globals@9.17.0

| +-- babel-types@6.24.1

| | `-- to-fast-properties@1.0.2

| +-- babylon@6.16.1

| +-- convert-source-map@1.5.0

| +-- debug@2.6.3

| | `-- ms@0.7.2

| +-- json5@0.5.1

| +-- lodash@4.17.4

| +-- minimatch@3.0.3

| | `-- brace-expansion@1.1.7

| | +-- balanced-match@0.4.2

| | `-- concat-map@0.0.1

| +-- path-is-absolute@1.0.1

| +-- private@0.1.7

| +-- slash@1.0.0

| `-- source-map@0.5.6

+-- babel-loader@6.4.1

| +-- find-cache-dir@0.1.1

| | +-- commondir@1.0.1

| | `-- pkg-dir@1.0.0

| | `-- find-up@1.1.2

| | `-- path-exists@2.1.0

| +-- loader-utils@0.2.17

| | +-- big.js@3.1.3

| | `-- emojis-list@2.1.0

| +-- mkdirp@0.5.1

| | `-- minimist@0.0.8

| `-- object-assign@4.1.1

+-- babel-plugin-transform-runtime@6.23.0

+-- babel-preset-env@1.3.3

| +-- babel-plugin-check-es2015-constants@6.22.0

| +-- babel-plugin-syntax-trailing-function-commas@6.22.0

| +-- babel-plugin-transform-async-to-generator@6.24.1

| | +-- babel-helper-remap-async-to-generator@6.24.1

| | `-- babel-plugin-syntax-async-functions@6.13.0

| +-- babel-plugin-transform-es2015-arrow-functions@6.22.0

| +-- babel-plugin-transform-es2015-block-scoped-functions@6.22.0

| +-- babel-plugin-transform-es2015-block-scoping@6.24.1

| +-- babel-plugin-transform-es2015-classes@6.24.1

| | +-- babel-helper-define-map@6.24.1

| | +-- babel-helper-function-name@6.24.1

| | +-- babel-helper-optimise-call-expression@6.24.1

| | `-- babel-helper-replace-supers@6.24.1

| +-- babel-plugin-transform-es2015-computed-properties@6.24.1

| +-- babel-plugin-transform-es2015-destructuring@6.23.0

| +-- babel-plugin-transform-es2015-duplicate-keys@6.24.1

| +-- babel-plugin-transform-es2015-for-of@6.23.0

| +-- babel-plugin-transform-es2015-function-name@6.24.1

| +-- babel-plugin-transform-es2015-literals@6.22.0

| +-- babel-plugin-transform-es2015-modules-amd@6.24.1

| +-- babel-plugin-transform-es2015-modules-commonjs@6.24.1

| | `-- babel-plugin-transform-strict-mode@6.24.1

| +-- babel-plugin-transform-es2015-modules-systemjs@6.24.1

| | `-- babel-helper-hoist-variables@6.24.1

| +-- babel-plugin-transform-es2015-modules-umd@6.24.1

| +-- babel-plugin-transform-es2015-object-super@6.24.1

| +-- babel-plugin-transform-es2015-parameters@6.24.1

| | +-- babel-helper-call-delegate@6.24.1

| | `-- babel-helper-get-function-arity@6.24.1

| +-- babel-plugin-transform-es2015-shorthand-properties@6.24.1

| +-- babel-plugin-transform-es2015-spread@6.22.0

| +-- babel-plugin-transform-es2015-sticky-regex@6.24.1

| | `-- babel-helper-regex@6.24.1

| +-- babel-plugin-transform-es2015-template-literals@6.22.0

| +-- babel-plugin-transform-es2015-typeof-symbol@6.23.0

| +-- babel-plugin-transform-es2015-unicode-regex@6.24.1

| | `-- regexpu-core@2.0.0

| | +-- regenerate@1.3.2

| | +-- regjsgen@0.2.0

| | `-- regjsparser@0.1.5

| | `-- jsesc@0.5.0

| +-- babel-plugin-transform-exponentiation-operator@6.24.1

| | +-- babel-helper-builder-binary-assignment-operator-visitor@6.24.1

| | | `-- babel-helper-explode-assignable-expression@6.24.1

| | `-- babel-plugin-syntax-exponentiation-operator@6.13.0

| +-- babel-plugin-transform-regenerator@6.24.1

| | `-- regenerator-transform@0.9.11

| `-- invariant@2.2.2

| `-- loose-envify@1.3.1

+-- babel-preset-stage-2@6.24.1

| +-- babel-plugin-syntax-dynamic-import@6.18.0

| +-- babel-plugin-transform-class-properties@6.24.1

| | `-- babel-plugin-syntax-class-properties@6.13.0

| +-- babel-plugin-transform-decorators@6.24.1

| | +-- babel-helper-explode-class@6.24.1

| | | `-- babel-helper-bindify-decorators@6.24.1

| | `-- babel-plugin-syntax-decorators@6.13.0

| `-- babel-preset-stage-3@6.24.1

| +-- babel-plugin-transform-async-generator-functions@6.24.1

| | `-- babel-plugin-syntax-async-generators@6.13.0

| `-- babel-plugin-transform-object-rest-spread@6.23.0

| `-- babel-plugin-syntax-object-rest-spread@6.13.0

+-- babel-register@6.24.1

| +-- core-js@2.4.1

| +-- home-or-tmp@2.0.0

| | +-- os-homedir@1.0.2

| | `-- os-tmpdir@1.0.2

| `-- source-map-support@0.4.14

+-- chalk@1.1.3

| +-- ansi-styles@2.2.1

| +-- escape-string-regexp@1.0.5

| +-- has-ansi@2.0.0

| | `-- ansi-regex@2.1.1

| +-- strip-ansi@3.0.1

| `-- supports-color@2.0.0

+-- connect-history-api-fallback@1.3.0

+-- copy-webpack-plugin@4.0.1

| +-- bluebird@2.11.0

| +-- fs-extra@0.26.7

| | +-- graceful-fs@4.1.11

| | +-- jsonfile@2.4.0

| | `-- klaw@1.3.1

| +-- glob@6.0.4

| | +-- inflight@1.0.6

| | | `-- wrappy@1.0.2

| | +-- inherits@2.0.3

| | `-- once@1.4.0

| +-- is-glob@3.1.0

| | `-- is-extglob@2.1.1

| `-- node-dir@0.1.16

+-- css-loader@0.26.4

| +-- css-selector-tokenizer@0.7.0

| | +-- cssesc@0.1.0

| | +-- fastparse@1.1.1

| | `-- regexpu-core@1.0.0

| +-- cssnano@3.10.0

| | +-- decamelize@1.2.0

| | +-- defined@1.0.0

| | +-- has@1.0.1

| | | `-- function-bind@1.1.0

| | +-- postcss-calc@5.3.1

| | | +-- postcss-message-helpers@2.0.0

| | | `-- reduce-css-calc@1.3.0

| | | +-- math-expression-evaluator@1.2.16

| | | `-- reduce-function-call@1.0.2

| | +-- postcss-colormin@2.2.2

| | | `-- colormin@1.1.2

| | | +-- color@0.11.4

| | | | +-- clone@1.0.2

| | | | +-- color-convert@1.9.0

| | | | | `-- color-name@1.1.2

| | | | `-- color-string@0.3.0

| | | `-- css-color-names@0.0.4

| | +-- postcss-convert-values@2.6.1

| | +-- postcss-discard-comments@2.0.4

| | +-- postcss-discard-duplicates@2.1.0

| | +-- postcss-discard-empty@2.1.0

| | +-- postcss-discard-overridden@0.1.1

| | +-- postcss-discard-unused@2.2.3

| | | `-- uniqs@2.0.0

| | +-- postcss-filter-plugins@2.0.2

| | | `-- uniqid@4.1.1

| | | `-- macaddress@0.2.8

| | +-- postcss-merge-idents@2.1.7

| | +-- postcss-merge-longhand@2.0.2

| | +-- postcss-merge-rules@2.1.2

| | | +-- caniuse-api@1.6.1

| | | | +-- lodash.memoize@4.1.2

| | | | `-- lodash.uniq@4.5.0

| | | `-- vendors@1.0.1

| | +-- postcss-minify-font-values@1.0.5

| | +-- postcss-minify-gradients@1.0.5

| | +-- postcss-minify-params@1.2.2

| | | `-- alphanum-sort@1.0.2

| | +-- postcss-minify-selectors@2.1.1

| | +-- postcss-normalize-charset@1.1.1

| | +-- postcss-normalize-url@3.0.8

| | | +-- is-absolute-url@2.1.0

| | | `-- normalize-url@1.9.1

| | | +-- prepend-http@1.0.4

| | | +-- query-string@4.3.2

| | | | `-- strict-uri-encode@1.1.0

| | | `-- sort-keys@1.1.2

| | | `-- is-plain-obj@1.1.0

| | +-- postcss-ordered-values@2.2.3

| | +-- postcss-reduce-idents@2.4.0

| | +-- postcss-reduce-initial@1.0.1

| | +-- postcss-reduce-transforms@1.0.4

| | +-- postcss-svgo@2.1.6

| | | +-- is-svg@2.1.0

| | | | `-- html-comment-regex@1.1.1

| | | `-- svgo@0.7.2

| | | +-- coa@1.0.1

| | | | `-- q@1.5.0

| | | +-- colors@1.1.2

| | | +-- csso@2.3.2

| | | | `-- clap@1.1.3

| | | +-- sax@1.2.2

| | | `-- whet.extend@0.9.9

| | +-- postcss-unique-selectors@2.0.2

| | `-- postcss-zindex@2.2.0

| +-- loader-utils@1.1.0

| +-- lodash.camelcase@4.3.0

| +-- postcss-modules-extract-imports@1.0.1

| +-- postcss-modules-local-by-default@1.1.1

| | `-- css-selector-tokenizer@0.6.0

| | `-- regexpu-core@1.0.0

| +-- postcss-modules-scope@1.0.2

| | `-- css-selector-tokenizer@0.6.0

| | `-- regexpu-core@1.0.0

| +-- postcss-modules-values@1.2.2

| | `-- icss-replace-symbols@1.0.2

| `-- source-list-map@0.1.8

+-- eventsource-polyfill@0.9.6

+-- express@4.15.2

| +-- accepts@1.3.3

| | +-- mime-types@2.1.15

| | | `-- mime-db@1.27.0

| | `-- negotiator@0.6.1

| +-- array-flatten@1.1.1

| +-- content-disposition@0.5.2

| +-- content-type@1.0.2

| +-- cookie@0.3.1

| +-- cookie-signature@1.0.6

| +-- debug@2.6.1

| +-- depd@1.1.0

| +-- encodeurl@1.0.1

| +-- escape-html@1.0.3

| +-- etag@1.8.0

| +-- finalhandler@1.0.1

| | `-- unpipe@1.0.0

| +-- fresh@0.5.0

| +-- merge-descriptors@1.0.1

| +-- methods@1.1.2

| +-- on-finished@2.3.0

| | `-- ee-first@1.1.1

| +-- parseurl@1.3.1

| +-- path-to-regexp@0.1.7

| +-- proxy-addr@1.1.4

| | +-- forwarded@0.1.0

| | `-- ipaddr.js@1.3.0

| +-- qs@6.4.0

| +-- range-parser@1.2.0

| +-- send@0.15.1

| | +-- debug@2.6.1

| | +-- destroy@1.0.4

| | `-- http-errors@1.6.1

| +-- serve-static@1.12.1

| +-- setprototypeof@1.0.3

| +-- statuses@1.3.1

| +-- type-is@1.6.15

| | `-- media-typer@0.3.0

| +-- utils-merge@1.0.0

| `-- vary@1.1.1

+-- extract-text-webpack-plugin@2.1.0

| +-- ajv@4.11.6

| | +-- co@4.6.0

| | `-- json-stable-stringify@1.0.1

| | `-- jsonify@0.0.0

| +-- async@2.3.0

| +-- loader-utils@1.1.0

| `-- webpack-sources@0.1.5

+-- file-loader@0.10.1

| `-- loader-utils@1.1.0

+-- friendly-errors-webpack-plugin@1.6.1

| +-- error-stack-parser@2.0.0

| | `-- stackframe@1.0.2

| `-- string-length@1.0.1

+-- html-webpack-plugin@2.28.0

| +-- bluebird@3.5.0

| +-- html-minifier@3.4.3

| | +-- camel-case@3.0.0

| | | +-- no-case@2.3.1

| | | | `-- lower-case@1.1.4

| | | `-- upper-case@1.1.3

| | +-- clean-css@4.0.12

| | +-- ncname@1.0.0

| | | `-- xml-char-classes@1.0.0

| | +-- param-case@2.1.1

| | `-- relateurl@0.2.7

| +-- pretty-error@2.1.0

| | +-- renderkid@2.0.1

| | | +-- css-select@1.2.0

| | | | +-- boolbase@1.0.0

| | | | +-- css-what@2.1.0

| | | | +-- domutils@1.5.1

| | | | | `-- dom-serializer@0.1.0

| | | | | +-- domelementtype@1.1.3

| | | | | `-- entities@1.1.1

| | | | `-- nth-check@1.0.1

| | | +-- dom-converter@0.1.4

| | | | `-- utila@0.3.3

| | | +-- htmlparser2@3.3.0

| | | | +-- domelementtype@1.3.0

| | | | +-- domhandler@2.1.0

| | | | +-- domutils@1.1.6

| | | | `-- readable-stream@1.0.34

| | | | `-- isarray@0.0.1

| | | `-- utila@0.3.3

| | `-- utila@0.4.0

| `-- toposort@1.0.3

+-- http-proxy-middleware@0.17.4

| +-- http-proxy@1.16.2

| | +-- eventemitter3@1.2.0

| | `-- requires-port@1.0.0

| `-- micromatch@2.3.11

| +-- arr-diff@2.0.0

| | `-- arr-flatten@1.0.1

| +-- array-unique@0.2.1

| +-- braces@1.8.5

| | +-- expand-range@1.8.2

| | | `-- fill-range@2.2.3

| | | +-- is-number@2.1.0

| | | +-- isobject@2.1.0

| | | | `-- isarray@1.0.0

| | | +-- randomatic@1.1.6

| | | `-- repeat-string@1.6.1

| | +-- preserve@0.2.0

| | `-- repeat-element@1.1.2

| +-- expand-brackets@0.1.5

| | `-- is-posix-bracket@0.1.1

| +-- extglob@0.3.2

| | `-- is-extglob@1.0.0

| +-- filename-regex@2.0.0

| +-- is-extglob@1.0.0

| +-- is-glob@2.0.1

| +-- kind-of@3.1.0

| | `-- is-buffer@1.1.5

| +-- normalize-path@2.1.1

| | `-- remove-trailing-separator@1.0.1

| +-- object.omit@2.0.1

| | `-- is-extendable@0.1.1

| +-- parse-glob@3.0.4

| | +-- glob-base@0.3.0

| | | `-- is-glob@2.0.1

| | | `-- is-extglob@1.0.0

| | +-- is-dotfile@1.0.2

| | +-- is-extglob@1.0.0

| | `-- is-glob@2.0.1

| `-- regex-cache@0.4.3

| +-- is-equal-shallow@0.1.3

| `-- is-primitive@2.0.0

+-- opn@4.0.2

| `-- pinkie-promise@2.0.1

| `-- pinkie@2.0.4

+-- optimize-css-assets-webpack-plugin@1.3.0

| `-- underscore@1.8.3

+-- ora@1.2.0

| +-- cli-cursor@2.1.0

| | `-- restore-cursor@2.0.0

| | +-- onetime@2.0.1

| | | `-- mimic-fn@1.1.0

| | `-- signal-exit@3.0.2

| +-- cli-spinners@1.0.0

| `-- log-symbols@1.0.2

+-- rimraf@2.6.1

| `-- glob@7.1.1

| `-- fs.realpath@1.0.0

+-- sass-loader@6.0.3

| +-- clone-deep@0.2.4

| | +-- for-own@0.1.5

| | | `-- for-in@1.0.2

| | +-- is-plain-object@2.0.1

| | | `-- isobject@1.0.2

| | +-- lazy-cache@1.0.4

| | `-- shallow-clone@0.1.2

| | +-- kind-of@2.0.1

| | +-- lazy-cache@0.2.7

| | `-- mixin-object@2.0.1

| | `-- for-in@0.1.8

| +-- loader-utils@1.1.0

| +-- lodash.tail@4.1.1

| `-- pify@2.3.0

+-- semver@5.3.0

+-- shelljs@0.7.7

| +-- glob@7.1.1

| +-- interpret@1.0.2

| `-- rechoir@0.6.2

| `-- resolve@1.3.2

| `-- path-parse@1.0.5

+-- url-loader@0.5.8

| +-- loader-utils@1.1.0

| `-- mime@1.3.4

+-- vue@2.2.6

+-- vue-loader@11.3.4

| +-- consolidate@0.14.5

| | `-- bluebird@3.5.0

| +-- hash-sum@1.0.2

| +-- js-beautify@1.6.12

| | +-- config-chain@1.1.11

| | | +-- ini@1.3.4

| | | `-- proto-list@1.2.4

| | +-- editorconfig@0.13.2

| | | +-- bluebird@3.5.0

| | | +-- lru-cache@3.2.0

| | | `-- sigmund@1.0.1

| | `-- nopt@3.0.6

| | `-- abbrev@1.1.0

| +-- loader-utils@1.1.0

| +-- lru-cache@4.0.2

| | +-- pseudomap@1.0.2

| | `-- yallist@2.1.2

| +-- postcss-load-config@1.2.0

| | +-- cosmiconfig@2.1.1

| | | +-- js-yaml@3.7.0

| | | | +-- argparse@1.0.9

| | | | | `-- sprintf-js@1.0.3

| | | | `-- esprima@2.7.3

| | | +-- minimist@1.2.0

| | | +-- parse-json@2.2.0

| | | | `-- error-ex@1.3.1

| | | | `-- is-arrayish@0.2.1

| | | `-- require-from-string@1.2.1

| | +-- postcss-load-options@1.2.0

| | `-- postcss-load-plugins@2.3.0

| +-- postcss-selector-parser@2.2.3

| | +-- flatten@1.0.2

| | +-- indexes-of@1.0.1

| | `-- uniq@1.0.1

| +-- vue-hot-reload-api@2.0.11

| `-- vue-template-es2015-compiler@1.5.2

+-- vue-router@2.4.0

+-- vue-style-loader@2.0.5

| `-- loader-utils@1.1.0

+-- vue-template-compiler@2.2.6

| +-- de-indent@1.0.2

| `-- he@1.1.1

+-- webpack@2.3.3

| +-- acorn@4.0.11

| +-- acorn-dynamic-import@2.0.2

| +-- ajv-keywords@1.5.1

| +-- enhanced-resolve@3.1.0

| +-- json-loader@0.5.4

| +-- loader-runner@2.3.0

| +-- memory-fs@0.4.1

| | +-- errno@0.1.4

| | | `-- prr@0.0.0

| | `-- readable-stream@2.2.9

| | +-- buffer-shims@1.0.0

| | +-- core-util-is@1.0.2

| | +-- isarray@1.0.0

| | +-- process-nextick-args@1.0.7

| | +-- string_decoder@1.0.0

| | `-- util-deprecate@1.0.2

| +-- node-libs-browser@2.0.0

| | +-- assert@1.4.1

| | +-- browserify-zlib@0.1.4

| | | `-- pako@0.2.9

| | +-- buffer@4.9.1

| | | +-- base64-js@1.2.0

| | | +-- ieee754@1.1.8

| | | `-- isarray@1.0.0

| | +-- console-browserify@1.1.0

| | | `-- date-now@0.1.4

| | +-- constants-browserify@1.0.0

| | +-- crypto-browserify@3.11.0

| | | +-- browserify-cipher@1.0.0

| | | | +-- browserify-aes@1.0.6

| | | | | `-- buffer-xor@1.0.3

| | | | +-- browserify-des@1.0.0

| | | | | `-- des.js@1.0.0

| | | | `-- evp_bytestokey@1.0.0

| | | +-- browserify-sign@4.0.4

| | | | +-- bn.js@4.11.6

| | | | +-- browserify-rsa@4.0.1

| | | | +-- elliptic@6.4.0

| | | | | +-- brorand@1.1.0

| | | | | +-- hash.js@1.0.3

| | | | | +-- hmac-drbg@1.0.1

| | | | | +-- minimalistic-assert@1.0.0

| | | | | `-- minimalistic-crypto-utils@1.0.1

| | | | `-- parse-asn1@5.1.0

| | | | `-- asn1.js@4.9.1

| | | +-- create-ecdh@4.0.0

| | | +-- create-hash@1.1.2

| | | | +-- cipher-base@1.0.3

| | | | +-- ripemd160@1.0.1

| | | | `-- sha.js@2.4.8

| | | +-- create-hmac@1.1.4

| | | +-- diffie-hellman@5.0.2

| | | | `-- miller-rabin@4.0.0

| | | +-- pbkdf2@3.0.9

| | | +-- public-encrypt@4.0.0

| | | `-- randombytes@2.0.3

| | +-- domain-browser@1.1.7

| | +-- events@1.1.1

| | +-- https-browserify@0.0.1

| | +-- os-browserify@0.2.1

| | +-- path-browserify@0.0.0

| | +-- process@0.11.9

| | +-- punycode@1.4.1

| | +-- querystring-es3@0.2.1

| | +-- readable-stream@2.2.9

| | | +-- isarray@1.0.0

| | | `-- string_decoder@1.0.0

| | +-- stream-browserify@2.0.1

| | | `-- readable-stream@2.2.9

| | | +-- isarray@1.0.0

| | | `-- string_decoder@1.0.0

| | +-- stream-http@2.7.0

| | | +-- builtin-status-codes@3.0.0

| | | +-- readable-stream@2.2.9

| | | | +-- isarray@1.0.0

| | | | `-- string_decoder@1.0.0

| | | +-- to-arraybuffer@1.0.1

| | | `-- xtend@4.0.1

| | +-- string_decoder@0.10.31

| | +-- timers-browserify@2.0.2

| | | `-- setimmediate@1.0.5

| | +-- tty-browserify@0.0.0

| | +-- url@0.11.0

| | | `-- punycode@1.3.2

| | +-- util@0.10.3

| | | `-- inherits@2.0.1

| | `-- vm-browserify@0.0.4

| | `-- indexof@0.0.1

| +-- supports-color@3.2.3

| | `-- has-flag@1.0.0

| +-- tapable@0.2.6

| +-- uglify-js@2.8.22

| | +-- uglify-to-browserify@1.0.2

| | `-- yargs@3.10.0

| | +-- camelcase@1.2.1

| | +-- cliui@2.1.0

| | | +-- center-align@0.1.3

| | | | `-- align-text@0.1.4

| | | | `-- longest@1.0.1

| | | +-- right-align@0.1.3

| | | `-- wordwrap@0.0.2

| | `-- window-size@0.1.0

| +-- watchpack@1.3.1

| | `-- chokidar@1.6.1

| | +-- anymatch@1.3.0

| | | `-- arrify@1.0.1

| | +-- async-each@1.0.1

| | +-- glob-parent@2.0.0

| | | `-- is-glob@2.0.1

| | | `-- is-extglob@1.0.0

| | +-- is-binary-path@1.0.1

| | | `-- binary-extensions@1.8.0

| | +-- is-glob@2.0.1

| | | `-- is-extglob@1.0.0

| | `-- readdirp@2.1.0

| | +-- readable-stream@2.2.9

| | | +-- isarray@1.0.0

| | | `-- string_decoder@1.0.0

| | `-- set-immediate-shim@1.0.1

| +-- webpack-sources@0.2.3

| | `-- source-list-map@1.1.1

| `-- yargs@6.6.0

| +-- camelcase@3.0.0

| +-- cliui@3.2.0

| | `-- wrap-ansi@2.1.0

| +-- get-caller-file@1.0.2

| +-- os-locale@1.4.0

| | `-- lcid@1.0.0

| | `-- invert-kv@1.0.0

| +-- read-pkg-up@1.0.1

| | `-- read-pkg@1.1.0

| | +-- load-json-file@1.1.0

| | | `-- strip-bom@2.0.0

| | | `-- is-utf8@0.2.1

| | +-- normalize-package-data@2.3.6

| | | +-- hosted-git-info@2.4.2

| | | +-- is-builtin-module@1.0.0

| | | | `-- builtin-modules@1.1.1

| | | `-- validate-npm-package-license@3.0.1

| | | +-- spdx-correct@1.0.2

| | | | `-- spdx-license-ids@1.2.2

| | | `-- spdx-expression-parse@1.0.4

| | `-- path-type@1.1.0

| +-- require-directory@2.1.1

| +-- require-main-filename@1.0.1

| +-- set-blocking@2.0.0

| +-- string-width@1.0.2

| | +-- code-point-at@1.1.0

| | `-- is-fullwidth-code-point@1.0.0

| | `-- number-is-nan@1.0.1

| +-- which-module@1.0.0

| +-- y18n@3.2.1

| `-- yargs-parser@4.2.1

+-- webpack-bundle-analyzer@2.4.0

| +-- acorn@5.0.3

| +-- commander@2.9.0

| | `-- graceful-readlink@1.0.1

| +-- ejs@2.5.6

| +-- filesize@3.5.6

| +-- gzip-size@3.0.0

| | `-- duplexer@0.1.1

| `-- opener@1.4.3

+-- webpack-dev-middleware@1.10.1

+-- webpack-hot-middleware@2.18.0

| +-- ansi-html@0.0.7

| +-- html-entities@1.2.0

| `-- querystring@0.2.0

`-- webpack-merge@2.6.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch okidar\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} )

npm ERR! Windows_NT 6.1.7601

npm ERR! argv "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cl i.js" "install"

npm ERR! node v6.9.5

npm ERR! npm v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! node-sass@4.5.2 postinstall: `node scripts/build.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the node-sass@4.5.2 postinstall script 'node scripts/build.js '.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the node-sass package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR! node scripts/build.js

npm ERR! You can get information on how to open an issue for this project with:

npm ERR! npm bugs node-sass

npm ERR! Or if that isn't available, you can get their info via:

npm ERR! npm owner ls node-sass

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR! E:\workspace_vscode\yijianyiv1\npm-debug.log

  • 重点是我本地已经安装了Python了 ,DOS命令下是执行python,输出如下:

C:\Users\Administrator>python

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]

on win32

Type "help", "copyright", "credits" or "license" for more information.

>>>

回答:

表示node-sass并不需要python2...
我特意把环境变量清空,把python和node都删除,重新安装了python3.6.1(64x)和nodejsv6.10.2然后用cnpm install node-sass --save-dev就直接装上并且可以正常编译sassscss了。。
图片描述

node-sass是4.5.2,直接cnpm就安装成功了
图片描述

回答:

node-sass编译需要python2

你装的是python3

回答:

这个考虑两方面:
1、py及其版本
2、墙

回答:

1.安装python2.7

2.npm rebuild node-sass

回答:

问题已解决

  1. Python3和Python2确实有版本差异,删除3后安装2(python-2.7.6.msi

  2. cnpm install node-sass --save-dev

回答:

我把python卸载了重新 npm i 就行,
好像有python的情况下会用python编译一些东西,没有的话就直接下载dist的,不会编译.然后就好了

以上是 win7 install node-sass出错,提示not found: python2 的全部内容, 来源链接: utcz.com/a/165128.html

回到顶部