安装时报错信息:
gyp info spawn D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
gyp ERR! stack at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "D:\\Workstation\\agilebpm-spring-boot-starters\\agilebpm-ui\\src\\main\\resources\\static\\agilebpm-ui\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\Workstation\agilebpm-spring-boot-starters\agilebpm-ui\src\main\resources\static\agilebpm-ui\node_modules\node-sass
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! <https://github.com/nodejs/node-gyp/issues>
Build failed with error code: 7
npm WARN c@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.8.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.8.3 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\aroce\AppData\Roaming\npm-cache\_logs\2019-10-20T03_53_47_863Z-debug.log
打开日志信息末尾的保存信息
3183 warn c@1.0.0 No repository field.
3184 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
3185 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
3186 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
3186 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
3186 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
3186 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
3187 verbose stack Error: node-sass@4.8.3 postinstall: `node scripts/build.js`
3187 verbose stack Exit status 1
3187 verbose stack at EventEmitter.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
3187 verbose stack at EventEmitter.emit (events.js:198:13)
3187 verbose stack at ChildProcess.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
3187 verbose stack at ChildProcess.emit (events.js:198:13)
3187 verbose stack at maybeClose (internal/child_process.js:982:16)
3187 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
3188 verbose pkgid node-sass@4.8.3
3189 verbose cwd D:\Workstation\agilebpm-spring-boot-starters\agilebpm-ui\src\main\resources\static\agilebpm-ui
3190 verbose Windows_NT 10.0.17134
3191 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
3192 verbose node v10.16.3
3193 verbose npm v6.9.0
3194 error code ELIFECYCLE
3195 error errno 1
3196 error node-sass@4.8.3 postinstall: `node scripts/build.js`
3196 error Exit status 1
3197 error Failed at the node-sass@4.8.3 postinstall script.
3197 error This is probably not a problem with npm. There is likely additional logging output above.
3198 verbose exit [ 1, true ]
发现是在安装node-sass时失败,在网上搜索解决方案,在问答中发现使用淘宝源安装就没有问题,亲测有效。
$ npm install -g cnpm --registry=https://registry.npm.taobao.org (安装淘宝镜像)
$ cnpm install node-sass --save (使用淘宝镜像安装node-sass)