node-sass安装失败问题解决

全局安装依赖的时候,因为node-sass报错

Module build failed (from .[表情]de_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from .[表情]de_modules[表情]ss-loader[表情]b/loader.js):
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (72)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.11.0
    at module.exports (E:\Git\pmdm-web\node_modules\[email protected]@node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (E:\Git\pmdm-web\node_modules\[email protected]@node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules[表情]s/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules[表情]s/loader.js:1178:10)
    at Module.load (internal/modules[表情]s/loader.js:1002:32)
    at Function.Module._load (internal/modules[表情]s/loader.js:901:14)
    at Module.require (internal/modules[表情]s/loader.js:1044:19)
    at require (internal/modules[表情]s/helpers.js:77:18)
    at Object.sassLoader (E:\Git\pmdm-web\node_modules\sass-loader\lib\loader.js:46:72)
    at E:\Git\pmdm-web\node_modules\webpack\lib\NormalModule.js:301:20
    at E:\Git\pmdm-web\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at E:\Git\pmdm-web\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at runSyncOrAsync (E:\Git\pmdm-web\node_modules\loader-runner\lib\LoaderRunner.js:143:3)
    at iterateNormalLoaders (E:\Git\pmdm-web\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at E:\Git\pmdm-web\node_modules\loader-runner\lib\LoaderRunner.js:186:6
    at context.callback (E:\Git\pmdm-web\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at E:\Git\pmdm-web\node_modules\cache-loader\dist\index.js:171:7
    at E:\Git\pmdm-web\node_modules\neo-async\async.js:2830:7
    at done (E:\Git\pmdm-web\node_modules\neo-async\async.js:2865:11)
    at E:\Git\pmdm-web\node_modules\neo-async\async.js:2818:7
    at E:\Git\pmdm-web\node_modules\cache-loader\dist\index.js:160:9
    at E:\Git\pmdm-web\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:85:15
    at processTicksAndRejections (internal/process/task_queues.js:79:11)

 尝试了先卸载node-sass 

npm uninstall node-sass

  再安装

npm i node-sass

 还是报错,这次貌似跟Python相关但是不用管它

[email protected] install E:\Git\pmdm-web\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-72_binding.node":

ESOCKETTIMEDOUT

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

> [email protected] postinstall E:\Git\pmdm-web\node_modules\node-sass
> node scripts[表情]ild.js

Building: D:\node.exe E:\Git\pmdm-web\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'D:\\node.exe',
gyp verb cli   'E:\\Git\\pmdm-web\\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 verb cli ]
gyp info using [email protected]
gyp info using [email protected] | 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:\Git\pmdm-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\Git\pmdm-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\Git\pmdm-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (E:\Git\pmdm-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\Git\pmdm-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\Git\pmdm-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (E:\\Git\\pmdm-web\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (E:\\Git\\pmdm-web\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (E:\\Git\\pmdm-web\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at E:\\Git\\pmdm-web\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at E:\\Git\\pmdm-web\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at E:\\Git\\pmdm-web\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:166:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (E:\Git\pmdm-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\Git\pmdm-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\Git\pmdm-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (E:\Git\pmdm-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\Git\pmdm-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\Git\pmdm-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\Git\pmdm-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n' +
gyp verb `which` failed     '    at getNotFoundError (E:\\Git\\pmdm-web\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (E:\\Git\\pmdm-web\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (E:\\Git\\pmdm-web\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at E:\\Git\\pmdm-web\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at E:\\Git\\pmdm-web\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at E:\\Git\\pmdm-web\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:166:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb could not find "python". checking python launcher
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (E:\Git\pmdm-web\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at callback (E:\Git\pmdm-web\node_modules\node-gyp\node_modules\graceful-fs\polyfills.js:295:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:166:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "D:\\node.exe" "E:\\Git\\pmdm-web\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\Git\pmdm-web\node_modules\node-sass
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN [email protected] requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts[表情]ild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\movit\AppData\Roaming\npm-cache\_logs\2020-03-16T13_32_04_414Z-debug.log

  使用下面的方法 这次终于成功了

npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass

  

猜你喜欢

转载自www.cnblogs.com/tw6668/p/12507369.html