0

I want to install this web part from hhttps://github.com/AsishP/SPFxWebParts , but when i run this command gulp build i got this error Error - [tslint] Error: Cannot find module '@microsoft/rush-stack-compiler-3.2'. here is my full cmd outputs. any advice please?

C:\SPFxWebParts-master\SPFxWebParts-master>gulp clean
Build target: DEBUG
[16:46:55] Using gulpfile C:\SPFxWebParts-master\SPFxWebParts-master\gulpfile.js
[16:46:55] Starting 'clean'...
[16:46:55] Starting gulp
[16:46:55] Starting subtask 'clean'...
[16:46:55] Finished subtask 'clean' after 3.54 ms
[16:46:55] Finished 'clean' after 7.32 ms
[16:46:55] ==================[ Finished ]==================
[16:46:56] Project with unknown name version:unknown
[16:46:56] Build tools version:3.17.11
[16:46:56] Node version:v14.17.0
[16:46:56] Total duration:3.07 s

C:\SPFxWebParts-master\SPFxWebParts-master>
C:\SPFxWebParts-master\SPFxWebParts-master>npm install
npm WARN saveError ENOENT: no such file or directory, open 'C:\SPFxWebParts-master\SPFxWebParts-master\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\SPFxWebParts-master\SPFxWebParts-master\package.json'
npm WARN SPFxWebParts-master No description
npm WARN SPFxWebParts-master No repository field.
npm WARN SPFxWebParts-master No README data
npm WARN SPFxWebParts-master No license field.

up to date in 0.776s
found 0 vulnerabilities


C:\SPFxWebParts-master\SPFxWebParts-master>
C:\SPFxWebParts-master\SPFxWebParts-master>gulp build
Build target: DEBUG
[16:47:02] Using gulpfile C:\SPFxWebParts-master\SPFxWebParts-master\gulpfile.js
[16:47:02] Starting 'build'...
[16:47:02] Starting gulp
[16:47:02] Starting subtask 'configure-sp-build-rig'...
[16:47:02] Warning - [configure-sp-build-rig] Missing config.json file. If this is a non-web project, consider using a non-web build rig like @microsoft/sp-build-node
[16:47:02] Warning - [configure-sp-build-rig] This project is using an old config.json file version (undefined). Run the build again with the --upgrade (gulp --upgrade) flag to upgrade the config.json file to the latest version.
[16:47:02] Finished subtask 'configure-sp-build-rig' after 2.89 ms
[16:47:02] Starting subtask 'pre-copy'...
[16:47:02] Finished subtask 'pre-copy' after 113 ms
[16:47:02] Starting subtask 'copy-static-assets'...
[16:47:02] Starting subtask 'sass'...
[16:47:02] Finished subtask 'copy-static-assets' after 15 ms
[16:47:02] Finished subtask 'sass' after 6.61 ms
[16:47:02] Starting subtask 'tslint'...
[16:47:02] Error - [tslint] Error: Cannot find module '@microsoft/rush-stack-compiler-3.2'
Require stack:
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\RSCTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\TscCmdTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\index.js
- C:\node_modules\@microsoft\sp-build-web\lib\index.js
- C:\SPFxWebParts-master\SPFxWebParts-master\gulpfile.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
[16:47:02] Error - 'tslint' sub task errored after 5.9 ms
 Cannot find module '@microsoft/rush-stack-compiler-3.2'
Require stack:
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\RSCTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\TscCmdTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\index.js
- C:\node_modules\@microsoft\sp-build-web\lib\index.js
- C:\SPFxWebParts-master\SPFxWebParts-master\gulpfile.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
[16:47:02] Starting subtask 'tsc'...
[16:47:02] Error - [tsc] Error: Cannot find module '@microsoft/rush-stack-compiler-3.2'
Require stack:
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\RSCTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\TscCmdTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\index.js
- C:\node_modules\@microsoft\sp-build-web\lib\index.js
- C:\SPFxWebParts-master\SPFxWebParts-master\gulpfile.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
[16:47:02] Error - 'tsc' sub task errored after 1.8 ms
 Cannot find module '@microsoft/rush-stack-compiler-3.2'
Require stack:
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\RSCTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\TscCmdTask.js
- C:\node_modules\@microsoft\gulp-core-build-typescript\lib\index.js
- C:\node_modules\@microsoft\sp-build-web\lib\index.js
- C:\SPFxWebParts-master\SPFxWebParts-master\gulpfile.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js
- C:\Users\mohan\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
[16:47:02] 'build' errored after 146 ms
[16:47:02]
About to exit with code: 1
Process terminated before summary could be written, possible error in async code not continuing!
Trying to exit with exit code 1
4
  • 1
    1) What version of node.js are you using? 2) can you run npm list -g --depth=0 and post the results? Commented Nov 12, 2021 at 16:20
  • @DenisMolodtsov thanks for the reply .. here sis the result +-- @microsoft/[email protected] +-- [email protected] -- [email protected]`
    – John John
    Commented Nov 12, 2021 at 16:26
  • 1
    and what is the node version? can your run node --version? Commented Nov 12, 2021 at 18:17
  • 1
    @DenisMolodtsov it is v14.17.0
    – John John
    Commented Nov 12, 2021 at 18:19

1 Answer 1

1

This is a computability issue.

SharePoint Framework (SPFx) 1.7.1 requires the following

This is what you have. It won't work

  • node.js v14.17.0
  • npm: v6 (guessing here)
  • yeoman [email protected]. (for creating new projects only)

You can fix this issue by following these steps

  • Uninstall node.js completely.
  • Install nvm (Node version manager). When dealing with SPFx, it's a must. because you need multiple node.js versions installed on your computer. Instead of uninstalling and reinstalling them all the time, nvm makes it very simple to switch from one node.js version to another on-the-fly.
  • Install correct version of node.js supported by SPFx 1.7.1: nvm install 8.16.2
  • [Optional] Install any other node.js versions using nvm install <Whatever_version_you_want> command
  • run nvm use 8.16.2 to switch to node.js that is compatible with your old SPFx solution.
  • Re-do all your steps mentioned in your post again.
  • Whenever you need to switch to the different version of node, simply run nvm use < version of node.js >
20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.