I've created a webpart.
I'm using a Node.js, with npm, Yeoman and Gulp.
I installed a certificate with gulp trust-dev-cert, and I have this error on my page "This site can provide a secure connection", and the app isn't accessible.
This is my package.json
My node version is 8.9.1.
I tried to change the NODE_NO_HTTP2=1 environment variable , like this tutorial , but it doesn't work.
Do you have any idea to resolve my certificate problem ?
Thank you very much
Not sure why it isn't working after NODE_NO_HTTP2=1 changes.
I would suggest that you uninstall the current Node.js installation and reinstall the Node.js with the previous LTS version.
The previous Node.js version is v 6.12.
You can download it and install it on your machine and then run the gulp commands.
Link - Node.js v6.12.0
As mentioned here, currently only Node v6 is supported in SPFx
Related
I am going to deploy Typescript(React) app on the Dreamhost.
But I don't know how to do that.
I can connect by SSH to the server.
Should I install npm by SSH then run that?
I saw an option about passenger on the Dreamhost server.
If I select this check box, then message shows requires VPS or dedicated server running a recent OS version.
But I don't know at all about how to do this. I have been using Dreamhost for only few months.
Please help me.
What requires a VPS or Dedicated server, is the RVM module:
Regarding your question: Node.js is not installed by default on newer DreamHost servers. You must manually install a custom version under your server's username.
Once installed, npm is also installed and you'll be able to run the commands below.
View the following article for instructions on how to install a custom version of Node.js.
Installing a custom version of NVM and Node.js
Is there anyway we can setup SharePoint framework development environment offline without internet connection?
Following this instruction,
https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment
It failed on the second step,
npm install -g yo gulp
If your node modules were already installed, then yes, you can develop offline. But the npm install command very specifically downloads and installs the package you specify.
If you can find a colleague who already has those modules installed and you can copy from their machine to yours, you could potentially get it setup without an internet connection, but you are going to have to get those SPFx packages (Yeoman Gulp and Microsoft Generator) from somewhere.
I am new angular2 development, and what i came to know is before starin the angular2 development, I must install the nodejs for server and npm to download dependencies from official documentation.
I succesfully deployed the source code in tomcat sever[by build]
So my Question is after installation and creating the new project, i got node_modules. By using these node_modules(can i start development of angular2 on another i.e a new machine where node & npm is not installed)
Basically my question is.. I want to start development of angular2 by using the project structure on new machine. Without the installation on node & npm
From Angular docs
Node.js and npm are essential to Angular development.
If you built/compiled the app and have all the modules installed (you have your node_modules) folder then its just javascript and html which you can run on any server you want.
For npm, if you need any modules/packages, I think you can manually download the package and add it to your development environment. But what if the process needs to be automated? You can't just sit there and download all the packages from github. So npm is really helpful when it come to this. You only need a file containing all dependencies, and run it at build time (package.json)
About nodejs, nodejs allows you to run javascript on the server when you need any interaction with the database. So why don't we just go with the easy way?
I have a project where I want to use the latest EmberJS to develop under. Currently, node 0.10.4 is installed on the machine I was given, which is a hard requirement for a backend system that I will need. Since the nodejs is so outdated, I cannot install the latest Ember on this machine without updating the NodeJs. My ember app has to communicate to the backend system through socket.io, is it possible to create a virtual development environment on this machine to develop Ember with the latest nodejs and also be able to easily configure the socket.io connection during development?
I believe once Ember is compiled down to distribution files, I can easily migrate these files into the public folder of my outdated nodejs with no problem, but correct me if I'm wrong
Any ideas on a solution that is easy to configure without asking for a new machine?
The easiest way to handle this situation is to use Node Version Manager (NVM).
Just follow the install instructions located here.
Then you can simply type nvm install <desired version of node>.
For example, when developing your backend system, first type nvm install v0.10.4. And when developing your Ember app, type nvm install v6.0.0.
(Note: to find out what versions of node are available to download, run nvm ls-remote).
If you use Linux - you can do following steps:
create new user
download archive with latest node.js version from here:
extract archive to any folder in new user /home directory
then switch to created user and do echo "export PATH=$PATH:/path/to/your/latest/node/bin/node" >> ~/.bashrc;
Then you should be available to use node.js 7.*.* only for this user, but default version for other users will be 0.10.4
I am trying to install socket.io on windows with npm for use on a nodeJS server.
First, when I typed "npm install socket.IO" i had an error in the log saying something about python and node-gyp. I installed python 2.7.3 and set the environment variables.
Now I got a new error, which has something to do with visual studio (what the hell does VS have to do with npm ? Is it about the compiler? ).
The error is the same as here npm install for some packages (sqlite3, socket.io) fail with error MSB8020 on Windows 7
But when I use the option in the answer instead of the error it tells me something about a possible data loss (c4267) but doesn't log any error.
Then when I start my app, it tells me cannot find module socket.io still
What could this come from ?
Oh and also when i do npm config get root it tells me "undefined" could it have anything to do with it ?
Should I install the modules globally or locally ?
At least one of the packages in Socket.IO's dependency tree is a C/C++ addons which needs to be compiled on your system as it's installed. And, since it's a dependency, if it doesn't succeed in installing, neither will Socket.IO.
To enable cross-system compilation, Node.js uses node-gyp as its build system. You'll need to have it installed as a global package:
npm install -g node-gyp
As well as have its dependencies installed. Abridged version:
Python 2
C/C++ Compiler / Build Tools
For Windows, Microsoft Visual Studio 2013 (C++ or Windows Desktop) (Express edition)
For 64-bit, may need Windows 7 64-bit SDK
Then, you should be able to install Socket.IO as a local package so you can require it:
npm install socket.io
I had a similar problem on Mac.
What resolved my problem is installing a slightly older version of Socket.io.
I did:
npm install socket.io#"~0.8.1"
which would install the latest version between 0.8.0 to 0.8.9, but not 0.9.0 or above.
Socket.io then installed perfectly.
Make sure you have all the required software to run node-gyp:
https://github.com/TooTallNate/node-gyp
You can configure version of Visual Studio used by gyp via an environment variable so you can avoid having to set the --msvs_version=2012 property.
Examples:
set GYP_MSVS_VERSION=2012 for Visual Studio 2012
set GYP_MSVS_VERSION=2013e (the 'e' stands for 'express edition')
For the full list see
- https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294
This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.
Feel free to add your vote at:
https://github.com/joyent/node/issues/8005#issuecomment-50545326
The problem causing the compile failure is that the ws module installed by the engine.io module required by socket.io pulls in a backlevel version of nan. See https://github.com/BrowserSync/grunt-browser-sync/issues/95 for details. To work around the problem after the build failure:
cd to node_modules/socket.io/node_modules/engine.io/node_modules/ws
edit package.json to change the release of nan from 1.4.x to 1.6.0
issue command node-gyp rebuild
You should now be able to use socket.io
Another approach is to use Docker for Windows and spin up a NodeJS environment. While developing you can mount your Node code as a Docker volume and so continue to update your code from Windows but execute it and install it's dependencies inside a Linux VM. When you deploy you might prefer to use a Dockerfile that COPY's your Node code into your Docker image and so bakes it into the release image you deploy.
This approach might be required if you don't want to risk changing the socket.io version of your code or its dependencies.
It also may be a valuable solution if you planned to deploy to a corporate Intranet or public/private Cloud.
Docker can also be very handy for testing deployment under different versions of Node without disturbing the development environment of your Windows computer (e.g. for testing a NodeJS lib).
Official NodeJS Docker images
An explanation of how to use these images
this problem makes me very troubled..
I tried many solutions.
I installed .NET Framework 2.0 SDK.
I installed Python 2.7.x
I installed VS 2012 Express
I set some paths
I executed npm install xxx with the argument --msvs_version=2010(or 2012/2013..)...
But all failed.
finally, I uninstalled Python & .NET Framework 2.0 SDK & VS 2012, clear those paths,enable Windows Update, install all essential updates, restart my computer
then execute commands below:
npm install node-gyp -g
npm install socket.io -g
npm install browser-sync -g
there is no errors in installation logs.
Note : this solution may not work for you, but for me