SOLVED

node_modules/@microsoft folder disappears as SPFx installation fails

Contributor

I am attempting to install the public preview of SharePoint Framework (SPFx) 1.15 so that I can test out some of the expected features like support for TypeScript 4 and Node 16. This is a clean install on a clean machine.

 

The SPFx installation fails with the node_modules/@microsoft folder disappearing during the installation. I believe I have isolated the portion of the log from when the installation was fine and then went wrong, see below. I am not familiar enough with this to recognize any obvious problem or know if this would be a bug with SPFx 1.15.0-beta.1.

 

Any suggestions?

 

7422 timing build:link:node_modules/@microsoft/generator-sharepoint/node_modules/copy-concurrently/node_modules/rimraf Completed in 126ms
7423 timing build:link:node_modules/@microsoft/generator-sharepoint/node_modules/fstream/node_modules/rimraf Completed in 126ms
7424 timing build:link:node_modules/@microsoft/generator-sharepoint/node_modules/move-concurrently/node_modules/rimraf Completed in 125ms
7425 timing build:link:node_modules/@microsoft/generator-sharepoint/node_modules/node-gyp/node_modules/mkdirp Completed in 125ms
7426 timing build:link:node_modules/@microsoft/generator-sharepoint/node_modules/node-gyp/node_modules/semver Completed in 125ms
7427 timing build:link:node_modules/@microsoft/generator-sharepoint/node_modules/recast/node_modules/esprima Completed in 125ms
7428 timing build:link Completed in 132ms
7429 info run node-sass@4.14.1 install node_modules/@microsoft/generator-sharepoint/node_modules/node-sass node scripts/install.js
7430 info run node-sass@4.14.1 install { code: 0, signal: null }
7431 timing build:run:install:node_modules/@microsoft/generator-sharepoint/node_modules/node-sass Completed in 509ms
7432 timing build:run:install Completed in 510ms
7433 info run node-sass@4.14.1 postinstall node_modules/@microsoft/generator-sharepoint/node_modules/node-sass node scripts/build.js
7434 info run node-sass@4.14.1 postinstall { code: 1, signal: null }
7435 timing reify:rollback:createSparse Completed in 6160ms
7436 timing reify:rollback:retireShallow Completed in 0ms
7437 timing command:install Completed in 21188ms
7438 verbose stack Error: command failed
7438 verbose stack at ChildProcess.<anonymous> (C:\Users\Darian\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
7438 verbose stack at ChildProcess.emit (node:events:526:28)
7438 verbose stack at maybeClose (node:internal/child_process:1092:16)
7438 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
7439 verbose pkgid node-sass@4.14.1
7440 verbose cwd C:\Users\Darian\OneDrive - Darian Glover\SPFx.Projects\HelloWorld
7441 verbose Windows_NT 10.0.19044
7442 verbose node v16.14.2
7443 verbose npm v8.6.0
7444 error code 1
7445 error path C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\node-sass
7446 error command failed
7447 error command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
7448 error Building: C:\Program Files\nodejs\node.exe C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
7449 error gyp info it worked if it ends with ok
7449 error gyp verb cli [
7449 error gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
7449 error gyp verb cli 'C:\\Users\\Darian\\AppData\\Roaming\\npm\\node_modules\\@microsoft\\generator-sharepoint\\node_modules\\node-gyp\\bin\\node-gyp.js',
7449 error gyp verb cli 'rebuild',
7449 error gyp verb cli '--verbose',
7449 error gyp verb cli '--libsass_ext=',
7449 error gyp verb cli '--libsass_cflags=',
7449 error gyp verb cli '--libsass_ldflags=',
7449 error gyp verb cli '--libsass_library='
7449 error gyp verb cli ]
7449 error gyp info using node-gyp@3.8.0
7449 error gyp info using node@16.14.2 | win32 | x64
7449 error gyp verb command rebuild []
7449 error gyp verb command clean []
7449 error gyp verb clean removing "build" directory
7449 error gyp verb command configure []
7449 error gyp verb check python checking for Python executable "python2" in the PATH
7449 error gyp verb `which` failed Error: not found: python2
7449 error gyp verb `which` failed at getNotFoundError (C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:13:12)
7449 error gyp verb `which` failed at F (C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:68:19)
7449 error gyp verb `which` failed at E (C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:80:29)
7449 error gyp verb `which` failed at C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:89:16
7449 error gyp verb `which` failed at C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\isexe\index.js:42:5
7449 error gyp verb `which` failed at C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\isexe\windows.js:36:5
7449 error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
7449 error gyp verb `which` failed python2 Error: not found: python2
7449 error gyp verb `which` failed at getNotFoundError (C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:13:12)
7449 error gyp verb `which` failed at F (C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:68:19)
7449 error gyp verb `which` failed at E (C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:80:29)
7449 error gyp verb `which` failed at C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\which\which.js:89:16
7449 error gyp verb `which` failed at C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\isexe\index.js:42:5
7449 error gyp verb `which` failed at C:\Users\Darian\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\isexe\windows.js:36:5
7449 error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
7449 error gyp verb `which` failed code: 'ENOENT'
7449 error gyp verb `which` failed }

 

1 Reply
best response confirmed by Darian Glover (Contributor)
Solution

Answering my own question after testing and consulting with @Vesa Juvonen, 1.15.0-beta.1 does not support Node 16. Support for Node 16 is expected in a following beta release.

 

Hope this helps others who may encounter compatibility issues.