Tag Archives: Sass

[Solved] Vue Project Error: Syntax Error: TypeError: this.getOptions is not a function

Question:

Vue project, NPM run dev, the following error:

Or

reason:

The installed sass loader version is too high. Reinstall the lower version sass-loader.

Solution:

// Uninstall the current version
npm uninstall sass-loader

// Install the specified version
npm install --save-dev sass-loader@10

[Solved] error C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass: Command failed.Exit code: 1

Vue-cli scaffolding to build a Vue project reports an error due to the installation of node-sass:

error C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\Users\HP\Desktop\VueProject\vue_cli\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   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\HP\\Desktop\\VueProject\\vue_cli\\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 download using dist-url https://oss.npmmirror.com/dist/node
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 (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\HP\anaconda3\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\HP\anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HP\\Desktop\\VueProject\\vue_cli\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass
gyp ERR! node -v v16.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
 ERROR  command failed: yarn

 

wrong reason:
The nodejs version is too high, my version is 16.x

Solution:
win+R open the cmd window and enter

node -v

Check the installed node version. If it is not v14.3.0, uninstall the original version and reinstall nodejs of v14.3.0.

Create the project again and solve it successfully!

Nodejs download address of v14.3.0 is attached:

Syntax Error: Error: Node Sass version 6.0.1 is incompatible with ^4.0.0.

Problem: version correspondence
solution:

    uninstall node sass

    npm uninstall node-sass
    
      install version 4.14.1

      npm install [email protected]
      
        network problems may occur during installation. Taobao image can be used. It is recommended to use the following methods. It is not recommended to permanently use Taobao image
        single use

        npm install --registry=https://registry.npm.taobao.org
        
          if you still cannot install, you can find the corresponding version number in the package.json file and modify it directly. The version number I use here is
          node sass: 4.14.1
          sass loader: 7.1.3
          generally, the idea will remind the update dependency in the lower right corner, otherwise the node will be deleted directly_ Download the modules folder again

          Reference link 1
          reference link 2

Vue installs sass loader directly, and node sass reports an error

Vue installs sass loader directly, and node-sass reports an error

An error will be reported when using NPM I sass loader node sass - d to install directly. This is because the version of SASS loader is too high. Please install sass loader version 7.3.1

If you also need to customize the theme color, you happen to add a file named element variables.SCSS directly under SRC instead of using the command. Then you will encounter the incompatibility of node-sass versions later. On October 28, 2021, I installed version 6.0.1 here. At this time, I can change it to version 4.14.1

Vue3 uses element plus package to solve the problem of occasionally disordered code on the icon after it goes online

Unlike element UI, element plus does not use node sass or dart sass, but sass and sass loader. At first, I thought it might be that the sass version and sass loader version of the project are inconsistent with the version of element plus, so I deleted the version of my project and installed the version consistent with the version used by element plus, but the problem is not solved. The version is as follows:

 "devDependencies": {
    "postcss-loader": "^5.3.0",
    "sass": "^1.35.1",
    "sass-loader": "^10.0.1",
  }

After tossing around for a while, I found an article on the Internet (the solution of icon garbled code packaged by dart sass compiled element UI). This is a solution for element UI, but I don’t know whether it is effective for element plus. Therefore, after using this method for element plus according to the instructions, I found that it is also effective, so I made a record, The steps are as follows:
1. Install the plug-in CSS Unicode loader;

yarn add css-unicode-loader -D //npm install css-unicode-loader -D

2. In vue.config.js configuration, I used the object writing method, and here it is modified to function writing method

// vue.config.js
module.exports = {
  configureWebpack: config => {
    config.module.rules.filter(rule => {
      return rule.test.toString().indexOf("scss") !== -1;
    }).forEach(rule => {
        rule.oneOf.forEach(oneOfRule => {
          oneOfRule.use.splice(oneOfRule.use.indexOf(require.resolve('sass-loader')), 0,
          	{ loader: require.resolve("css-unicode-loader")})
        })
      })
    }
}

Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.

When we use sass in a project, we need to parse sass into CSS through sass loader. If node sass is not installed, sass loader will not work.

Sometimes, if the node sass version is too high, an error will be reported. The log is as follows:

Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.

terms of settlement:

1. Uninstall the installed version of NPM install node sass
2. Install NPM install [email protected]
3. Restart the project

 

How to Solve Error: Module did not self-register

1. Error description

[scss/sass] 14:56:38.373 internal/modules/cjs/loader.js:717
[scss/sass] 14:56:38.373   return process.dlopen(module, path.toNamespacedPath(filename));
[scss/sass] 14:56:38.373                  ^
[scss/sass] 14:56:38.373 Error: Module did not self-register.
[scss/sass] 14:56:38.373     at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
[scss/sass] 14:56:38.373     at Module.load (internal/modules/cjs/loader.js:598:32)
[scss/sass] 14:56:38.373     at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[scss/sass] 14:56:38.373     at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[scss/sass] 14:56:38.373     at Module.require (internal/modules/cjs/loader.js:636:17)
[scss/sass] 14:56:38.373     at require (internal/modules/cjs/helpers.js:20:18)
[scss/sass] 14:56:38.373     at module.exports (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\binding.js:19:10)
[scss/sass] 14:56:38.373     at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\index.js:14:35)
[scss/sass] 14:56:38.373     at Module._compile (internal/modules/cjs/loader.js:688:30)
[scss/sass] 14:56:38.373     at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

2. Error reason
The error message is that the module is not registered and installed with NPM Install, but the result is still an error, indicating that the module has not been successfully installed

G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>npm install

> [email protected] install G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china
> node scripts/install.js

node-sass build Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china\vendor\win32-x64-64\binding.node

> [email protected] postinstall G:\HBuilderX\plugins\compile-node-sass\node_
modules\node-sass-china
> node scripts/build.js

Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-ch
ina\vendor\win32-x64-64\binding.node
Testing binary
Binary has a problem: Error: \\?\G:\HBuilderX\plugins\compile-node-sass\node_mod
ules\node-sass-china\vendor\win32-x64-64\binding.node is not a valid Win32 appli
cation.
\\?\G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\w
in32-x64-64\binding.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at module.exports (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-
sass-china\lib\binding.js:19:10)
    at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\n
ode-sass-china\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
Building the binary locally
Building: F:\nodejs\node.exe G:\HBuilderX\plugins\compile-node-sass\node_modules
\node-sass-china\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsa
ss_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'F:\\nodejs\\node.exe',
gyp verb cli   'G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sa
ss-china\\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 [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 (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (
G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_m
odules\\which\\which.js:13:12)\n    at F (G:\\HBuilderX\\plugins\\compile-node-s
ass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:68:19)\n    at
 E (G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\no
de_modules\\which\\which.js:80:29)\n    at G:\\HBuilderX\\plugins\\compile-node-
sass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:89:16\n    at
 G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_
modules\\isexe\\index.js:42:5\n    at G:\\HBuilderX\\plugins\\compile-node-sass\
\node_modules\\node-sass-china\\node_modules\\isexe\\windows.js:36:5\n    at FSR
eqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python E:\Python\Python36\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: E:\Python\Python36\python.EXE -c import sy
s; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:381:11)

gyp ERR! stack     at Socket.emit (events.js:182:13)
gyp ERR! stack     at Pipe._handle.close (net.js:606:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "F:\\nodejs\\node.exe" "G:\\HBuilderX\\plugins\\compile-node-sa
ss\\node_modules\\node-sass-china\\node_modules\\node-gyp\\bin\\node-gyp.js" "re
build" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--
libsass_library="
gyp ERR! cwd G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china

gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.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 log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     F:\nodejs\node_cache\_logs\2019-01-10T07_40_54_700Z-debug.log

G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>

3. Solutions
Uninstall and reinstall Sass related modules

C:\Users\Administrator.USER-0GUONPPBHK>npm uninstall node-sass -D
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

added 33 packages from 16 contributors, removed 22 packages and updated 340 pack
ages in 26.067s

C:\Users\Administrator.USER-0GUONPPBHK>npm install node-sass -D

> [email protected] install C:\Users\Administrator.USER-0GUONPPBHK\node_modules\n
ode-sass
> node scripts/install.js

Cached binary found at F:\nodejs\node_cache\node-sass\4.11.0\win32-x64-64_bindin
g.node

> [email protected] postinstall C:\Users\Administrator.USER-0GUONPPBHK\node_modul
es\node-sass
> node scripts/build.js

Binary found at C:\Users\Administrator.USER-0GUONPPBHK\node_modules\node-sass\ve
ndor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm WARN [email protected] requires a peer of vue@^2.5.2 but none is installed. Y
ou must install peer dependencies yourself.
npm WARN [email protected] requires a peer of vue@^2.5.0 but none is installed.
 You must install peer dependencies yourself.
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

+ [email protected]
added 110 packages from 118 contributors in 26.774s

C:\Users\Administrator.USER-0GUONPPBHK>

 

Error: Module did not self-register

1, error description

[编译scss/sass] 14:56:38.373 internal/modules/cjs/loader.js:717
[编译scss/sass] 14:56:38.373   return process.dlopen(module, path.toNamespacedPath(filename));
[编译scss/sass] 14:56:38.373                  ^
[编译scss/sass] 14:56:38.373 Error: Module did not self-register.
[编译scss/sass] 14:56:38.373     at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
[编译scss/sass] 14:56:38.373     at Module.load (internal/modules/cjs/loader.js:598:32)
[编译scss/sass] 14:56:38.373     at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[编译scss/sass] 14:56:38.373     at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[编译scss/sass] 14:56:38.373     at Module.require (internal/modules/cjs/loader.js:636:17)
[编译scss/sass] 14:56:38.373     at require (internal/modules/cjs/helpers.js:20:18)
[编译scss/sass] 14:56:38.373     at module.exports (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\binding.js:19:10)
[编译scss/sass] 14:56:38.373     at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\index.js:14:35)
[编译scss/sass] 14:56:38.373     at Module._compile (internal/modules/cjs/loader.js:688:30)
[编译scss/sass] 14:56:38.373     at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

2. Error

error indicates that the module has not been registered and installed with NPM Install, but the result still gives an error, indicating that the module has not been successfully installed

G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>npm install

> [email protected] install G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china
> node scripts/install.js

node-sass build Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china\vendor\win32-x64-64\binding.node

> [email protected] postinstall G:\HBuilderX\plugins\compile-node-sass\node_
modules\node-sass-china
> node scripts/build.js

Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-ch
ina\vendor\win32-x64-64\binding.node
Testing binary
Binary has a problem: Error: \\?\G:\HBuilderX\plugins\compile-node-sass\node_mod
ules\node-sass-china\vendor\win32-x64-64\binding.node is not a valid Win32 appli
cation.
\\?\G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\w
in32-x64-64\binding.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at module.exports (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-
sass-china\lib\binding.js:19:10)
    at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\n
ode-sass-china\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
Building the binary locally
Building: F:\nodejs\node.exe G:\HBuilderX\plugins\compile-node-sass\node_modules
\node-sass-china\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsa
ss_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'F:\\nodejs\\node.exe',
gyp verb cli   'G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sa
ss-china\\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 [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 (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (
G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_m
odules\\which\\which.js:13:12)\n    at F (G:\\HBuilderX\\plugins\\compile-node-s
ass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:68:19)\n    at
 E (G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\no
de_modules\\which\\which.js:80:29)\n    at G:\\HBuilderX\\plugins\\compile-node-
sass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:89:16\n    at
 G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_
modules\\isexe\\index.js:42:5\n    at G:\\HBuilderX\\plugins\\compile-node-sass\
\node_modules\\node-sass-china\\node_modules\\isexe\\windows.js:36:5\n    at FSR
eqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python E:\Python\Python36\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: E:\Python\Python36\python.EXE -c import sy
s; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:381:11)

gyp ERR! stack     at Socket.emit (events.js:182:13)
gyp ERR! stack     at Pipe._handle.close (net.js:606:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "F:\\nodejs\\node.exe" "G:\\HBuilderX\\plugins\\compile-node-sa
ss\\node_modules\\node-sass-china\\node_modules\\node-gyp\\bin\\node-gyp.js" "re
build" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--
libsass_library="
gyp ERR! cwd G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china

gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.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 log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     F:\nodejs\node_cache\_logs\2019-01-10T07_40_54_700Z-debug.log

G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>

3. Solution

reinstall

after uninstalling Sass related modules

C:\Users\Administrator.USER-0GUONPPBHK>npm uninstall node-sass -D
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

added 33 packages from 16 contributors, removed 22 packages and updated 340 pack
ages in 26.067s

C:\Users\Administrator.USER-0GUONPPBHK>npm install node-sass -D

> [email protected] install C:\Users\Administrator.USER-0GUONPPBHK\node_modules\n
ode-sass
> node scripts/install.js

Cached binary found at F:\nodejs\node_cache\node-sass\4.11.0\win32-x64-64_bindin
g.node

> [email protected] postinstall C:\Users\Administrator.USER-0GUONPPBHK\node_modul
es\node-sass
> node scripts/build.js

Binary found at C:\Users\Administrator.USER-0GUONPPBHK\node_modules\node-sass\ve
ndor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm WARN [email protected] requires a peer of vue@^2.5.2 but none is installed. Y
ou must install peer dependencies yourself.
npm WARN [email protected] requires a peer of vue@^2.5.0 but none is installed.
 You must install peer dependencies yourself.
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

+ [email protected]
added 110 packages from 118 contributors in 26.774s

C:\Users\Administrator.USER-0GUONPPBHK>