To run Node npm install without SSL, we set the registry to the non-secure registry URL.
To do this, we run
npm config set registry http://registry.npmjs.org/
to set the npm registry URL to http://registry.npmjs.org/.
To run Node npm install without SSL, we set the registry to the non-secure registry URL.
To do this, we run
npm config set registry http://registry.npmjs.org/
to set the npm registry URL to http://registry.npmjs.org/.
To send custom data along with handshake data in Node socket.io, we get the handshake data from the socket.manager.handshaken property.
For instance, we write
const socket = io.connect(window.location.origin, {
query: "loggeduser=user1",
});
io.sockets.on("connection", (socket) => {
const endp = socket.manager.handshaken[socket.id].address;
console.log(socket.manager.handshaken[socket.id].query.user);
});
to call connect to make the connection.
Then we listen for the connection event with on.
In the callback, we get the handshake data with socket.manager.handshaken
And we get the query string from the query property.
To fix Node already installed but not linked issue on Mac, we change the permission of a few folders and run brew link.
To fix this, we
Run sudo chmod 776 /usr/local/lib to change the permission of the /usr/local/lib to make the folder readable, writable and executable.
Run brew link --overwrite node to link Node.
Run sudo chmod 755 /usr/local/lib to change the directory to be readable and executable.
To fix react-native run-android is unrecognized error with Node, we should run this in the React Native project folder.
We run cd to change to the React Native project folder before running react-native run-android.
To fix Sass Loader Error: Invalid options object that does not match the API schema with JavaScript, we make sure the Webpack config has properties in the right places.
For instance, we write
module.exports = {
loader: "sass-loader",
options: {
sassOptions: {
indentedSyntax: true,
},
},
};
in webpack.config.js, to add the indentedSyntax property into sassOptions.