pnp/sp-dev-fx-extensions

"npm i" for react-application-announcements sample fails due to "@microsoft\gulp-core-build-sass"

ajagann1 opened this issue · 2 comments

Sample

react-application-announcements

Author(s)

Waldek Mastykarz

What happened?

Tried to install the sample to get an understanding of how to create a SharePoint artifact that displays banners on SharePoint pages but was roadblocked on the very first step. Every time I run "npm i" the operation fails due to some issue with the "microsoft\gulp-core-build-sass" node module. Here's a snippet of the error log:

Build FAILED.

"C:\Repository\sp-dev-fx-extensions\samples\react-application-announcements\node_modules\@microsoft\gulp-core-build-sass\node_modules\node-sass\build\binding.sln" (default target) (1) ->
"C:\Repository\sp-dev-fx-extensions\samples\react-application-announcements\node_modules\@microsoft\gulp-core-build-sass\node_modules\node-sass\build\binding.vcxproj.metaproj" (default target) (2) ->
"C:\Repository\sp-dev-fx-extensions\samples\react-application-announcements\node_modules\@microsoft\gulp-core-build-sass\node_modules\node-sass\build\src\libsass.vcxproj" (default target) (3) ->
(ClCompile target) ->
  TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Repository\sp-dev-fx-extensions\samples\react-application-announcements\node_modules\@microsoft\gulp-core-build-sass\node_modules\node-sass\build\src\libsass.vcxproj
]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.79
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Repository\sp-dev-fx-extensions\samples\react-application-announcements\node_modules\@microsoft\gulp-core-build-sass\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Repository\\sp-dev-fx-extensions\\samples\\react-application-announcements\\node_modules\\@microsoft\\gulp-core-build-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--
libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Repository\sp-dev-fx-extensions\samples\react-application-announcements\node_modules\@microsoft\gulp-core-build-sass\node_modules\node-sass
gyp ERR! node -v v14.19.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN uglifyjs-webpack-plugin@0.4.6 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 ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Could someone please look into this and provide a solution for the issue?

Steps to reproduce

  1. npm i (with Windows SDK 8.1 installed)

Expected behavior

Properly installed modules for the sample

Target SharePoint environment

SharePoint Online

Developer environment

Windows

Browsers

  • Internet Explorer
  • Microsoft Edge
  • Google Chrome
  • FireFox
  • Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Node.js version

v14.19.3

Additional environment details

No response

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

The sample you are referring to was build in SPFx 1.10, which is not compatible with Node.js 14. Please use the compatibility matrix and update your environment with a compatible version of Node.