Raghavendar Swaminathan

Raghavendar Swaminathan

  • 425
  • 3.6k
  • 142.2k

Sharepoint Framework Installation

Feb 16 2020 1:22 PM
Hi Team,
 
I couldnt able to setup SPFX environment successfully while i tried to launch the webpart using gulp-serve command i am getting the below error. 
 
Refered many links but the issue is not getting sorted out can anyone kindly assist.
 
 
 
Error: Cannot find module '@microsoft/sp-build-web'
Require stack:
- J:\SPFx Learning\gulpfile.js
- C:\Users\SPFx\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js
- C:\Users\SPFx\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js
- C:\Users\SPFx\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
at Function.Module._load (internal/modules/cjs/loader.js:863:27)
at Module.require (internal/modules/cjs/loader.js:1043:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object. (J:\SPFx Learning\gulpfile.js:3:15)
at Module._compile (internal/modules/cjs/loader.js:1157:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
at Module.load (internal/modules/cjs/loader.js:1001:32)
at Function.Module._load (internal/modules/cjs/loader.js:900:14)
at Module.require (internal/modules/cjs/loader.js:1043:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'J:\\SPFx Learning\\gulpfile.js',
'C:\\Users\\SPFx\\AppData\\Roaming\\npm\\node_modules\\gulp\\node_modules\\gulp-cli\\lib\\versioned\\^4.0.0\\index.js',
'C:\\Users\\SPFx\\AppData\\Roaming\\npm\\node_modules\\gulp\\node_modules\\gulp-cli\\index.js',
'C:\\Users\\SPFx\\AppData\\Roaming\\npm\\node_modules\\gulp\\bin\\gulp.js'
]
}
 
While i tried to install the  @microsoft/sp-build-web alone  that also throwing the error.
 
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\SPFx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '@microsoft/[email protected]'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 2ca0bfe489f496d8
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/@microsoft%2fsp-build-web 454ms (from cache)
8 silly pacote version manifest for @microsoft/[email protected] fetched in 541ms
9 timing stage:loadCurrentTree Completed in 1569ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 4ms
13 silly install loadShrinkwrap
14 timing stage:rollbackFailedOptional Completed in 1ms
15 timing stage:runTopLevelLifecycles Completed in 1695ms
16 silly saveTree [email protected]
17 verbose stack TypeError: Cannot read property 'match' of undefined
17 verbose stack at tarballToVersion (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\lib\install\inflate-shrinkwrap.js:87:20)
17 verbose stack at inflatableChild (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\lib\install\inflate-shrinkwrap.js:99:22)
17 verbose stack at C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\lib\install\inflate-shrinkwrap.js:55:12
17 verbose stack at tryCatcher (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
17 verbose stack at Object.gotValue (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:155:18)
17 verbose stack at Object.gotAccum (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:144:25)
17 verbose stack at Object.tryCatcher (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
17 verbose stack at Promise._settlePromiseFromHandler (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:517:31)
17 verbose stack at Promise._settlePromise (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:574:18)
17 verbose stack at Promise._settlePromise0 (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:619:10)
17 verbose stack at Promise._settlePromises (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:699:18)
17 verbose stack at _drainQueueStep (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:138:12)
17 verbose stack at _drainQueue (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
17 verbose stack at Async._drainQueues (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
17 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\SPFx\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
17 verbose stack at processImmediate (internal/timers.js:456:21)
18 verbose cwd J:\SPFx Learning
19 verbose Windows_NT 10.0.18363
20 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\SPFx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "@microsoft/[email protected]"
21 verbose node v12.16.0
22 verbose npm v6.13.1
23 error Cannot read property 'match' of undefined
24 verbose exit [ 1, true ]
Commands Tried.
 
Thanks
Raghav 
 

Answers (2)