Can't run “gulp trust-dev-cert”. Error “cannot read ”tostring“ of null”
-
08-02-2021 - |
Question
I am trying to build up a react web part for SharePoint, and I was following the instructions from Microsoft page :
On my personal PC it worked just fine, but in the office computer , whenever I try to run gulp trust-dev-cert
I get this:
C:\Users\ms327\Desktop\teste>gulp trust-dev-cert
Build target: DEBUG
[09:19:12] Using gulpfile ~\Desktop\teste\gulpfile.js
[09:19:12] Starting gulp
[09:19:12] Starting 'trust-dev-cert'...
[09:19:12] Starting subtask 'configure-sp-build-rig'...
[09:19:12] Finished subtask 'configure-sp-build-rig' after 32 ms
[09:19:12] Starting subtask 'trust-cert'...
[09:19:25] Error - [trust-cert] TypeError: Cannot read property 'toString' of null
[09:19:25] Error - 'trust-cert' sub task errored after 13 s
Cannot read property 'toString' of null
[09:19:25] 'trust-dev-cert' errored after 13 s
[09:19:25]
[09:19:26] ==================[ Finished ]==================
Error - [trust-cert] TypeError: Cannot read property 'toString' of null
Error - 'trust-cert' sub task errored after 13 s
Cannot read property 'toString' of null
[09:19:26] Project teste version:0.0.1
[09:19:26] Build tools version:3.9.26
[09:19:26] Node version:v8.16.0
[09:19:26] Total duration:47 s
[09:19:26] Task errors:2
Have already tried to run on Node 8.*
, 10.*
, deleted everything I could find about node on PC to make a clean reinstall, and I cant get through it.
If I run gulp serve
it works, but I cannot see my web part on SharePoint workbench.
Everything I find about this problem is related to node version. But already tried changing it several times.
even deleted .gcb-serve-data
from the root folder.
Any suggestion?
what can I do to make it work?
No correct solution
OTHER TIPS
You need to run it in the helloworld-webpart folder. If you have followed the instructions first you need to enter the folder
cd helloworld-webpart
Then Execute
gulp trust-dev-cert