gulp trust-dev-cert command not working for SharePoint Framework project creation
Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.
Category
- [ ] Question
- [ ] Typo - [ ] Bug -- It is a bug
- [ ] Additional article idea
Expected or Desired Behavior
I am trying to execute 'gulp trust-dev-cert not' this command in the project folder and getting the below error please help. I am following the instruction provided here in this page https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part to create a startup project for SharePoint Framework
Observed Behavior
PS C:\dev\spframework\helloworldsolution> gulp trust-dev-cert Build target: DEBUG [22:15:27] Using gulpfile C:\dev\spframework\helloworldsolution\gulpfile.js [22:15:27] Starting gulp [22:15:27] Starting 'trust-dev-cert'... [22:15:27] Starting subtask 'configure-sp-build-rig'... [22:15:27] Finished subtask 'configure-sp-build-rig' after 8.35 ms [22:15:27] Starting subtask 'trust-cert'... [22:15:29] Error - [trust-cert] TypeError: Cannot read property 'toString' of null [22:15:29] Error - 'trust-cert' sub task errored after 2.42 s Cannot read property 'toString' of null [22:15:29] 'trust-dev-cert' errored after 2.43 s [22:15:29] [22:15:30] ==================[ Finished ]================== Error - [trust-cert] TypeError: Cannot read property 'toString' of null Error - 'trust-cert' sub task errored after 2.42 s Cannot read property 'toString' of null [22:15:30] Project helloworldonline version: 0.0.1 [22:15:30] Build tools version: 3.0.5 [22:15:30] Node version: v8.9.1 [22:15:30] Total duration: 4.94 s [22:15:30] Task errors: 2
Thanks for your contribution! Sharing is caring.
Hi, I guess SPFx still not support Node version 8. If you downgrade Node version to 6.0 then it should work for you.
Yeah this is a Node 8 issue. We don't support Node 8 yet.
Are you sure it's Node v8? I'm running node v8.9.1 on macOS and the trust-dev-cert task works just fine.
Works fine in node v8.9.1 in Windows 7, I got alert pop up to install the certificate.
i am having the same issue even with node v6.0.0. Can someone please help me?
Any news about this?
OS Name: Microsoft Windows Server 2012 R2 Standard System Type: x64-based PC Node JS: 8.11.2 (Currently using 64-bit executable)
Build target: DEBUG [10:11:42] Using gulpfile ~\Desktop\helloworld-webpart\gulpfile.js [10:11:42] Starting gulp [10:11:42] Starting 'trust-dev-cert'... [10:11:42] Starting subtask 'trust-cert'... [10:11:44] Error - [trust-cert] TypeError: Cannot read property 'toString' of null [10:11:44] Error - 'trust-cert' sub task errored after 2.16 s Cannot read property 'toString' of null [10:11:44] 'trust-dev-cert' errored after 2.17 s [10:11:44] [10:11:45] ==================[ Finished ]================== Error - [trust-cert] TypeError: Cannot read property 'toString' of null Error - 'trust-cert' sub task errored after 2.16 s Cannot read property 'toString' of null [10:11:45] Project helloworld-webpart version: 0.0.1 [10:11:45] Build tools version: 2.5.3 [10:11:45] Node version: v8.11.2 [10:11:45] Total duration: 7.14 s [10:11:45] Task errors: 2
It worked for me after I downgraded node version to 6
First You need to Downgrade the Node version to below 9.0.0
then when your scaffolding is completed you need to get inside that folder suppose you have created hello world then you need go inside that folder then hit below command for creating certificate
" gulp trust-dev-cert" Then it will work
Still having issues? Lots of things have changed since originally posted (SPFx updated & now supported on Node.s v8)...
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.
Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.
am following the instructions from: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part Error is thrown while executing gulp trust-dev-cert command.Tried with Node 8.11.4 as mentioned. Even i tried .gcb-serve-data folder but still i get the same error. TypeError: Cannot read property 'toString' of null
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues