sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

gulp trust-dev-cert command not working for SharePoint Framework project creation

Open LakshmiMurugavadivelu opened this issue 9 years ago • 13 comments

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.

LakshmiMurugavadivelu avatar Nov 08 '17 12:11 LakshmiMurugavadivelu

Hi, I guess SPFx still not support Node version 8. If you downgrade Node version to 6.0 then it should work for you.

craghavendra21 avatar Nov 23 '17 05:11 craghavendra21

Yeah this is a Node 8 issue. We don't support Node 8 yet.

iclanton avatar Nov 27 '17 22:11 iclanton

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.

waldekmastykarz avatar Nov 29 '17 10:11 waldekmastykarz

Works fine in node v8.9.1 in Windows 7, I got alert pop up to install the certificate.

everydev avatar Dec 01 '17 01:12 everydev

i am having the same issue even with node v6.0.0. Can someone please help me?

gogreen0417 avatar Mar 03 '18 22:03 gogreen0417

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

wrobirson avatar Jun 05 '18 19:06 wrobirson

It worked for me after I downgraded node version to 6

Jontay005 avatar Oct 30 '18 16:10 Jontay005

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 gulp trust-dev-cert

anantv10 avatar Dec 06 '18 07:12 anantv10

Still having issues? Lots of things have changed since originally posted (SPFx updated & now supported on Node.s v8)...

andrewconnell avatar Feb 01 '19 11:02 andrewconnell

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.

msft-github-bot avatar Feb 08 '19 12:02 msft-github-bot

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.

msft-github-bot avatar Feb 15 '19 13:02 msft-github-bot

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

anthony-git avatar Dec 06 '19 05:12 anthony-git

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

msft-github-bot avatar Jan 28 '20 18:01 msft-github-bot