-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run gulp serve with 'NODE_NO_HTTP2=1' when using SPFx on node v8 #1002
Comments
@waldekmastykarz i tried this command but getting: The term 'NODE_NO_HTTP2=1' is not recognised as the name of a cmdlet. Also same thing when i try the command from Node.js command prompt: 'NODE_No_HTTP2' is not recognised as an internal or external command. I am on Node v8.9.0 Thanks |
I assume you're on Windows. See the following article to see how to set an environment variable for Node on Windows: https://stackoverflow.com/questions/9249830/how-can-i-set-node-env-production-on-windows |
Yes i am using Windows. My node js path is already in environment variable. I tried the commands 'set NODE_NO_HTTP2=1' but made no impact, even after restart. I tried different combination in that page but no avail. |
@Mike-tech have you also tried the following:
|
Confirmed: above works. After adding the environment variable, I had to restart my terminal (cmder) for the change to work. |
Because Node 8 went into LTS on November 1st, we'll be working on supporting it soon. For now only Node 6 is officially supported in SPFx. However, setting the |
@Mike-tech that's exactly the setting I have and it's working for me. |
@waldekmastykarz Many thanks for confirming that. Perhaps it's because i've now downgraded to node v6??? I will have to check this another time. I'm busy working on a SPFx project, so will stay with the stable v6. Cheers |
in package.json enter:
then npm run dev or yarn dev will work for you |
Saved the day dude :) thanks @waldekmastykarz ! |
does not work for me on my mac |
Echoed - this does not solve the issue on Mac. |
There's a known issue with Node.js v9 that does not respect the This DOES work on MacOS @lifayt if you are using Node v8 ... provided more detail in your other recent post: #1241 (comment) |
Cheers, thank you! |
I tried all install and uninstall of Node, NPM, Gulp & SpX. I was thinking I was missing the step with the documentation. But this post helped me. I added NODE_NO_HTTP2=1 in the environment variable and it worked. Thanks. This should be mentioned in the documentation of the SPx |
@pankajsurti I don't think it should be addressed. The docs clearly state SPFx is supported with Node.js v6.*. This env variable is only required for Node.js v8+... since they don't support it, calling it out adds confusion IMHO. Plus, I think the team is working on their workbench to resolve this. |
Aaaaaaannnnd this is resolved in the Yeoman Generator v1.4.1. Upgrade to that version for no workaround to use Node.js v8 LTS. |
I just tried the new yeoman generator 1.4.1 with Node.js 8.9.4 and it is still giving me Machine is a windows server 2016 datacenter hosted in azure
Did I miss something? Edit: doing the exact same steps on node.js 6.13.0 works perfectly fine. |
thanks ! |
I was facing the same issue, and just a npm update solved it! |
All working well for me since 1.4.1 update |
Confirming this working on OSX after upgrading my project to 1.4.1! No cert issues anymore. |
I have this issue on Ubuntu 18.04, node version - v8.10.0 with this packages installed $ npm list -g -depth 0 NODE_NO_HTTP2=1 helped, but still. |
Dont use the latest version of Node. I ran into numerous problems using the latest version. completely uninstall node and clear the npm cache. also uninstall Yeoman and gulp. Now, install an earlier version of node ( 6.11.5 worked for me). verify with node -v that you indeed have the version you want. thereafter install yeoman and gulp and follow the hello world example and everything will work this time. even gulp serve will work. hello world: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part |
Not sure that's the best advice. Node.js v8 works just fine with the latest versions of Yeoman (v2.0.5+), Gulp (v3.9.1) & the SPFx generator (v1.6.0. I suspect you |
linux fedora 28, with nvm nodejs v8.12.0 does not work, out of the box examples sp-dev-fx-webparts, seems like a really messy dev environment or not really cross-platform framework |
setting NODE_NO_HTTP2=1 didn't work out for me. I changed the port number on \config\serve.json and set "https" to false and then it worked out under Firefox. I am using Node v8.12.0 |
@martinpinto you shouldn't need to set that flag... if you are using Node v8.* & a recent version of the SPFx generator (the current version is v1.6.0), you don't need this flag. What problem are you having & what version of the generator are you running? |
I made NO_NODE_HTTP2 environment variable to 1. but it is not working. |
I am still getting Can’t connect securely to this page running the HelloWorld example |
What a terrible experience.. SharePoint is the most maddening thing I've ever dealt with. And some people think React is hard lol... |
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 |
Category
When working with SPFx on Node.js v8 you have to run gulp serve, like:
if you call
gulp serve
without the extra flag, you won't be able to open the workbench in the browser. This is caused by the experimental http/2 feature that is a part of Node v8.The text was updated successfully, but these errors were encountered: