Node.js : npm error, node file v8.h for node-gyp is not working - node.js

I am new to this website, and I may make mistakes while writing this question. Please tell me, in order to improve.
I work on Windows 10.
I am learning node.js, and I was looking for socket.io on npm. After searching for ages on the web, I didn't find an answer for a problem like mine. So, maybe it is easy to fix, but I am not familiar with IT in general.
Here is my problem, I write in my powershell: npm intall socket.io
A thousand error sentences appear on my powershell :
C:\Users\Rocp\.node-gyp\4.2.2\include\node\v8.h(336): error C2988: unrecognizable template declaration/definition [C:\U
sers\Rocp\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modul
es\bufferutil\build\bufferutil.vcxproj]
C:\Users\Rocp\.node-gyp\4.2.2\include\node\v8.h(336): error C2059: syntax error : 'using' [C:\Users\Rocp\node_modules\s
ocket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\build\buff
erutil.vcxproj]
C:\Users\Rocp\.node-gyp\4.2.2\include\node\v8.h(469): error C2988: unrecognizable template declaration/definition [C:\U
sers\Rocp\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modul
es\bufferutil\build\bufferutil.vcxproj]
...
until C:\users\Rocp\.node-gyp\4.2.2\include\node\v8.h (3478)
Moreover, it shows :
Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
failed with exit code: 1
Please note that I followed the tutorial for problems with npm :
I downloaded python 2.7.3 and set it with: npm config set python c:/python27/python.exe
I downloaded MSVS 2012 express, and I set it in the config too.

Related

Can't create a react native empty project, app.json not found

I am currently trying to get started with react native.
I set up the development environment referring to the documentation, but can't even pass the first step and create an empty project.
I am on Windows 11, Node 16.15.1, and NPM 8.12.2
I keep getting the following error when trying to init react-ative project with expo init awesomeProject
Error downloading and extracting template package: Error: npm exited with non-zero code: 1
× Something went wrong while downloading and extracting the template.
Can't read JSON file: D:\crna\awesomeProject\app.json
└─ Cause: Error: ENOENT: no such file or directory, open 'D:\crna\awesomeProject\app.json'
Does anyone has a suggestion ?
Don't really know what is the problem but i found a soluion that might help other people in the same situation as me! like said here just run in CMD instead of GitBash
Use sudo if on linux. And maybe Admin on windows.

Twilio Video Startup

I am fairly new to React and am trying to run an example to get started with understanding how Twilio interfaces with React/Node. I am currently using the repo https://github.com/twilio/twilio-video.js, and am trying to run the test > framework > twilio-video-react, but when I npm install then npm start, the server starts, but throws the error:
Failed to compile
./src/App.js
Module not found: Can't resolve 'twilio-video'
I did `npm install twilio-video`, but still throwing error. What am I missing here? Can anyone else get this example started? I want a base example with Twilio Video working with React so I can learn from there, any other resources would help, thanks!
I tried these two examples as well, but they are outdated:
https://www.twilio.com/blog/2018/03/video-chat-react.html
https://www.twilio.com/blog/2016/03/building-a-react-powered-video-chat.html
Okay, got an example up and running with a little fudging.
I followed this example: https://www.twilio.com/blog/2018/03/video-chat-react.html
But there were a few old libraries that were causing errors.
Posted a working version on my Github linked here.

(Visual Studio Code & NodeJS) - Could not install typings files for JavaScript language features?

I had installed latest NVM and used it to install NodeJS (macOS). Everything was okay, NodeJS ran normally. But when I started VS Code the following message appeared:
Could not install typings files for JavaScript language features. Please ensure that NPM is installed or configure 'typescript.npm' in your user settings
So I tried to find more official information from VS Code team. They said to insert the path to the npm executable file in the typescript.npm setting.
I used $ which npm to find the npm directory :
/Users/myusername/.nvm/versions/node/v8.3.0/bin/npm
but there is no executable file there. I also tried to insert this address into VSCode typescript.npm setting but it did not work.
My question is, where can I find the npm executable file address on macOS to insert into this typescript.npm setting so the error wouldn't pop up anymore ?
Thank you!
Releated VSCode issue: link Maybe it will help you.

"node-gyp build" Fatal error C1083

I'm trying to run a project on my windows 10 (x64) with nodejs.
To run the project, I was given a list of components/packages to install that included Bower, Ruby, Sass, Grunt, MySQL and Redis. Further components included installing node-gyp, node-canvas, Python 2.7 and Microsoft Build Tools
(Link: https://github.com/Automattic/node-canvas/wiki/Installation---Windows ).
After installing all the dependencies, I keep getting an error message :
c1xx : fatal error C1083: Cannot open source file: '..\src\binding.cc': No such file or directory [C:\myeffect\build\binding.vcxproj]
I've done everything I could to resolve the error, re-installed everything, added PATH to python on the System Variables, EVERYTHING.
But the error keeps coming. Please someone Help me what to do.
you can try it, i solved it.
create C:\myeffect\src\binding.cc。 bingd.cc file is empty file。

Npm package install failure

Trying to learn nodejs following a few articles. I'm able to download and make sure its working using a video from youtube. But now I'm trying to incorporate that in Visual Studio .net 4.5.2. I've tried to added it via new get package manager and the PM console each come back to same error.
"Install-Package: The specified path, file or both are to long. Less than 260 and directory name less than 248" Self explanatory, found this article
So I tried:
npm-flatten
npm-dedupe
also Enable Win32 long paths
It starts adding package npm 3.5.2 files and folders then bombs out and spits the same error. What else am I missing in order to get this package installed?
Thanks for any help

Resources