cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ben-thompson
Level 8

Cannot build react component due to 401 unauthorised error when installing the react npm packages

So I'm trying to build the new ts_reactstandardcomponent demo and I'm getting the following error message

 

pm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\BenThompson\AppData\Roaming\npm-cache\_logs\2019-06-20T07_04_34_355Z-debug.log

C:\Users\BenThompson\Downloads\SamplePCFControls\TS_ReactStandardControl>npm install react react-dom office-ui-fabric-react
npm ERR! code E401
npm ERR! 401 Unauthorized: office-ui-fabric-react@^6.189.0

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\BenThompson\AppData\Roaming\npm-cache\_logs\2019-06-20T07_23_55_603Z-debug.log

C:\Users\BenThompson\Downloads\SamplePCFControls\TS_ReactStandardControl>npm install
npm ERR! code E401
npm ERR! 401 Unauthorized: office-ui-fabric-react@^6.189.0

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\BenThompson\AppData\Roaming\npm-cache\_logs\2019-06-20T07_24_27_955Z-debug.log

C:\Users\BenThompson\Downloads\SamplePCFControls\TS_ReactStandardControl>

Full logfile is 

 

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'react',
1 verbose cli   'react-dom',
1 verbose cli   'office-ui-fabric-react' ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose npm-session 394f7b0df66c0a71
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 401 https://msazure.pkgs.visualstudio.com/_packaging/CAP_ISVExp_Tools_Internal/npm/registry/office-ui-fabric-react 425ms
8 silly fetchPackageMetaData error for office-ui-fabric-react@^6.189.0 401 Unauthorized: office-ui-fabric-react@^6.189.0
9 http fetch GET 401 https://msazure.pkgs.visualstudio.com/_packaging/CAP_ISVExp_Tools_Internal/npm/registry/react-dom 648ms
10 silly fetchPackageMetaData error for react-dom@^16.8.6 401 Unauthorized: react-dom@^16.8.6
11 http fetch GET 401 https://msazure.pkgs.visualstudio.com/_packaging/CAP_ISVExp_Tools_Internal/npm/registry/react 801ms
12 silly fetchPackageMetaData error for react@^16.8.6 401 Unauthorized: react@^16.8.6
13 timing stage:rollbackFailedOptional Completed in 5ms
14 timing stage:runTopLevelLifecycles Completed in 1045ms
15 verbose stack Error: 401 Unauthorized: office-ui-fabric-react@^6.189.0
15 verbose stack     at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
15 verbose stack     at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
15 verbose stack     at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
15 verbose stack     at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
15 verbose stack     at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
15 verbose stack     at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
15 verbose stack     at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
15 verbose stack     at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
15 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
15 verbose stack     at runCallback (timers.js:705:18)
15 verbose stack     at tryOnImmediate (timers.js:676:5)
15 verbose stack     at processImmediate (timers.js:658:5)
16 verbose cwd C:\Users\BenThompson\Downloads\SamplePCFControls\TS_ReactStandardControl
17 verbose Windows_NT 10.0.18362
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react" "react-dom" "office-ui-fabric-react"
19 verbose node v10.15.3
20 verbose npm  v6.4.1
21 error code E401
22 error 401 Unauthorized: office-ui-fabric-react@^6.189.0
23 verbose exit [ 1, true ]

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
indikaa
Level: Powered On

Re: Cannot build react component due to 401 unauthorised error when installing the react npm packages

Hi @ben-thompson ,

I have created a new project and used the code from the sample, then it worked.

5 REPLIES 5
indikaa
Level: Powered On

Re: Cannot build react component due to 401 unauthorised error when installing the react npm packages

Hi @BenJBauer , 

I'm getting the same error, trying to create same application manually and see what happen.

Highlighted
indikaa
Level: Powered On

Re: Cannot build react component due to 401 unauthorised error when installing the react npm packages

Hi @ben-thompson ,

I have created a new project and used the code from the sample, then it worked.

PowerApps Staff GregHurlmanMSFT
PowerApps Staff

Re: Cannot build react component due to 401 unauthorised error when installing the react npm packages

If you delete the .npmrc file, the sample should work.

 

Update: This has been resolved. A new, working version of the sample code can be found at https://aka.ms/pcfsamplecontrols.

sheldoncopper73
Level: Powered On

Re: Cannot build react component due to 401 unauthorised error when installing the react npm packages

 
ben-thompson
Level 8

Re: Cannot build react component due to 401 unauthorised error when installing the react npm packages

The link is at the bottom of https://docs.microsoft.com/en-us/powerapps/developer/component-framework/sample-controls/react-facep... which has a walkthrough on what it does...

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 53 members 4,707 guests
Please welcome our newest community members: