To build AppRTC server - node.js

there.
I have trouble to build https://github.com/webrtc/samples in win 8.1.
I am trying to install npm dependencies.
But there are some errors like as the following.
node.js version is v4.2.3 and npm version is v2.14.7
D:\_Temp\AppRTC\samples>npm install
> travis-multirunner#3.0.0 postinstall D:\_Temp\AppRTC\samples\node_modules\trav
is-multirunner
> ./bin/travis-sync
'.' is not recognized as an internal or external command,
operable program or batch file.
> chromedriver#2.20.0 install D:\_Temp\AppRTC\samples\node_modules\chromedriver
> node install.js
Downloading http://chromedriver.storage.googleapis.com/2.20/chromedriver_win32.z
ip
Saving to C:\Users\JIS\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
Receiving...
Received 782K...
Received 1564K...
Received 2346K...
Received 2398K total.
Extracting zip contents
Copying to target path D:\_Temp\AppRTC\samples\node_modules\chromedriver\lib\chr
omedriver
Done. ChromeDriver binary available at D:\_Temp\AppRTC\samples\node_modules\chro
medriver\lib\chromedriver\chromedriver.exe
> utf-8-validate#1.2.1 install D:\_Temp\AppRTC\samples\node_modules\selenium-web
driver\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver\node_modules\ws\node_mod
ules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\n
odejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gy
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
validation.cc
win_delay_load_hook.c
Creating library D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver\n
ode_modules\ws\node_modules\utf-8-validate\build\Release\validation.lib and o
bject D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver\node_modules\ws
\node_modules\utf-8-validate\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver
\node_modules\ws\node_modules\utf-8-validate\build\Release\\validation.node
> bufferutil#1.2.1 install D:\_Temp\AppRTC\samples\node_modules\selenium-webdriv
er\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver\node_modules\ws\node_mod
ules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodej
s\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js
" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
bufferutil.cc
win_delay_load_hook.c
Creating library D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver\n
ode_modules\ws\node_modules\bufferutil\build\Release\bufferutil.lib and objec
t D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver\node_modules\ws\nod
e_modules\bufferutil\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> D:\_Temp\AppRTC\samples\node_modules\selenium-webdriver
\node_modules\ws\node_modules\bufferutil\build\Release\\bufferutil.node
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.3
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! travis-multirunner#3.0.0 postinstall: `./bin/travis-sync`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the travis-multirunner#3.0.0 postinstall script './bin/travis
-sync'.
npm ERR! This is most likely a problem with the travis-multirunner package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./bin/travis-sync
npm ERR! You can get their info via:
npm ERR! npm owner ls travis-multirunner
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\_Temp\AppRTC\samples\npm-debug.log
D:\_Temp\AppRTC\samples>node test/server.js
D:\_Temp\AppRTC\samples\test\server.js:18
key: keys.serviceKey,
^
TypeError: Cannot read property 'serviceKey' of undefined
at D:\_Temp\AppRTC\samples\test\server.js:18:14
at D:\_Temp\AppRTC\samples\node_modules\pem\lib\pem.js:246:24
at D:\_Temp\AppRTC\samples\node_modules\pem\lib\pem.js:150:24
at D:\_Temp\AppRTC\samples\node_modules\pem\lib\pem.js:71:20
at D:\_Temp\AppRTC\samples\node_modules\pem\lib\pem.js:951:20
at D:\_Temp\AppRTC\samples\node_modules\pem\lib\pem.js:930:13
at D:\_Temp\AppRTC\samples\node_modules\pem\lib\pem.js:829:20
at D:\_Temp\AppRTC\samples\node_modules\pem\lib\pem.js:999:20
at F (D:\_Temp\AppRTC\samples\node_modules\pem\node_modules\which\which.js:7
3:25)
at E (D:\_Temp\AppRTC\samples\node_modules\pem\node_modules\which\which.js:7
6:29)
Thanks for any reply.

It's quite easy to setup a virtual machine using Virtualbox.
In fact I did just that at home on my gaming pc, just installed latest Debian, node.js, Sublime in a Virtualbox VM, then I use Virtualbox seamless mode which just puts the Windows in the VM on top of the host OS desktop.
Works great!

travis-multirunner which is used for automatted testing is not supported on windows.

Related

npm building issues for SyntaxHighlighter

I'm a beginner with npm and is trying to build SyntaxHighlighter version 4 by cloning it using git first, but failed. Here are the errors I got:
1 error generated.
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/name/syntaxhighlighter/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/Users/name/syntaxhighlighter/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/name/syntaxhighlighter/node_modules/node-sass
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN notsup Unsupported engine for karma#0.13.22: wanted: {"node":"0.10 || 0.12 || 4 || 5"} (current: {"node":"12.16.1","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: karma#0.13.22
npm WARN syntaxhighlighter#4.0.1 No description
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/name/.npm/_logs/2020-04-05T02_52_17_048Z-debug.log
The problem you are running into is that SyntaxHighlighter version 4 is too old and its dependencies are not supported by the version of Node you are running.
The package that the error is coming from is Karma. The version of Karma that is trying to install is v0.13.22. That version of Karma only supported a maximum Node version of 5, and you appear to be running version 12.
You could potentially solve this issue by downgrading your Node version, or using a tool like Node Version Manager (NVM) to temporarily downgrade your Node version.
NVM
Try to install node_modules only.
cd /syntaxhighlighter/node_modules$ and then try installing using npm install.
There are some errors in gulp.js file that are causing problems in the installation process. I have tried older versions but none of them is available. Hope this will work out.
robdonn's NVM solution works, however, I had a very unusual instance when running multiple versions of Node, managed through NVM, was breaking my ApiConnect/Loopback client (only on a Mac). I never figured out why but realize that running a single version of Node fixed the problem.
Also wanting to use syntaxhighlighter, I did manage to generate the syntaxhighlighter.js file using a Docker container. In the cloned directory I added the Dockerfile.
FROM node:5
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm#5+)
COPY package*.json ./
RUN npm install
# Bundle app source
COPY . .
Thereafter I was able to:
Build a local docker container
docker build -t syntaxhighlighter .
Run the container mapping my local dist directory to the container's dist directory
docker run -i --volume ~/github/syntaxhighlighter/dist:/usr/src/app/dist syntaxhighlighter
Got the container id for the local running container
docker ps
Used the container id to go into the container (could have also just put CMD ['/bin/sh'] in my Dockerfile)
docker exec -it <the-container-id> /bin/sh
Ran the gulp build from the Node v5 container. Since I am mapping my local dist directory to the container's dist directory, I get the output locally.
./node_modules/gulp/bin/gulp.js build --brushes=all --compat

node-gyp rebuild fails on Mac OS High Sierra while npm install

I am getting following error in the terminal, while it tries to install one of package "node-expat". I have tried switching to different node version using nvm but still it is failing with same error.
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/node-expat
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! node-expat#2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.0.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! c:\<redacted>\npm-debug.log
I went ahead installing x-code as suggested on git hub page, on my machine and then it is giving following error,. Not sure how to debug further.
xcode-select: error: tool 'xcodebuild' requires Xcode,
but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
I just got it fixed on my machine and my fellow colleagues machine.
Followed the following steps to fix it on MacOS highSierra 10.13:
Downloaded command line tools (MacOS 10.13) for xcode and installed it.
Download it from "https://developer.apple.com/download/more/"
Installed xcode 10.0 from the app store. Opened xcode and went through the regular configuration xcode does in the initial start up.
After this it started giving "xcode-select" path issue as stated in the description above. On running command "xcode-select --print-path" it was showing path as '/ Library/Developer/CommandLineTools', so i went ahead and tried "xcode-select --reset" after which the path changed to "/Applications/Xcode.app/Contents/Developer".
Immediately after it the build started working without any issues.
Solution above mentioned by Luke worked partially for me (MacOS) but created another issue :
gyp ERR! stack Error:makefailed with exit code: 2 which was solved by removing locked json file. Issue was created due to permission in MAC OS. So if you have xcode re-installed already, open terminal (command line) and type:
xcode-select --reset
then go to your project folder and remove:
package-lock.json
Now in terminal reinstall project :
npm install
I hope this helps someone!

NPM run dev command always fails at "grunt develop:quick" script

Using a cloned repository, I am trying to run npm run dev in order to develop locally. I have installed the grunt commands globally and my npm is recently updated. A possible problem I can see is that my node.js is at 5.10. However, if possible, I'd like to keep it there due to other team members having history with the repository not working on updated versions of node.js. The root of my repository is saved in the web folder and this is through Windows PowerShell(Admin).
PS C:\Users\<User>\Documents\GitHub\web> npm run dev
> web#12.5.6 dev C:\Users\<User>\Documents\GitHub\web
> grunt develop:quick
Running "develop:quick" (develop) task
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "copy:modules" (copy) task
Copied 24 files
Running "base-sass-config" task
Interim sass config file [client\styles\core\__config.scss] created.
Running "glob-sass-components" task
Traversing:
C:\Users\oalyousf\Documents\GitHub\web\client\src\components\pages
Traversing:
C:\Users\oalyousf\Documents\GitHub\web\client\src\components\building-blocks
Interim components glob file [client\styles\core\__components.scss] created.
Running "sass:static" (sass) task
>> File to import not found or unreadable: ....srcomponentspages­min-
consolestyles­min-console.scss
>> Parent style sheet:
C:/Users/<User>/Documents/GitHub/web/client/styles/core/__components.scss
>> Line 4 Column 1 client\styles\core\__components.scss
Warning: Use --force to continue.
Aborted due to warnings.
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v5.10.1
npm ERR! npm v3.8.3
npm ERR! code ELIFECYCLE
npm ERR! web#12.5.6 dev: `grunt develop:quick`
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the web#12.5.6 dev script 'grunt develop:quick'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the web package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! grunt develop:quick
npm ERR! You can get information on how to open an issue for this project
with:
npm ERR! npm bugs web
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls web
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\<User>\Documents\GitHub\web\npm-debug.log
PS C:\Users\<User>\Documents\GitHub\web>

‘node-gyp rebuild’ installation error when adding a package to meteor app in Windows 7

I was trying to add a package (mizzao:turkserver) to my Meteor application, but I kept getting this error:
mizzao:turkserver: updating npm dependencies -- request, libxmljs,
validator, querystring, async, deepmerge...
gypnpm ERR! Windows_NT 6.1.7601
npm ERR! argv
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\\\node.exe"
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\node_modules\\npm\\bin\\npm-cli.js"
"install" "libxmljs#0.8.1"
npm ERR! node v0.10.36
npm ERR! npm v2.7.3
npm ERR! code ELIFECYCLE
npm ERR! libxmljs#0.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the libxmljs#0.8.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.
=> Babel active on file extensions: es6.js, es6, jsx
=> Errors while adding packages:
While building package mizzao:turkserver:
error: couldn't install npm package
I am developing my Meteor application on a Windows 7 machine and from what I have been able to gather from posts on forums, the error seems to be related to that fact (interaction between npm and Windows - I did not find any posts describing the same problem on Linux machines).
I've already tried installing the latest Python version and MS Visual Studio 2013 as suggested here: https://github.com/TooTallNate/node-gyp#installation, as well as setting some environment variables as suggested here: https://github.com/atom/atom/issues/2754. But none of those helped.
Any help would be greatly appreciated!
As I described in this comment, this seems to be an issue with the Python path being set incorrectly for npm, as Meteor's distribution of npm isn't hooking it up correctly. Most Linux distros come with Python, but Windows doesn't, so it is correlated with running Windows.
It can be fixed by making sure that Python is installed, then running the following command:
npm config set python C:\Python27\python.exe
The use of an old libxmljs is because mizzao:turkserver is dependent on a relatively old node MTurk API, which I'd like to wean it off of at some point, but isn't such a high priority at the moment.
See also:
https://github.com/lovell/sharp/issues/163
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

Error Node downgrading

I am a beginner in development, but I want to become a leading developer of mobile applications ;)
I am on Windows 8. I want to install Cordova but I have to downgrade Node I currently 0.12.x. Version I could see that he had to make a downgrade in 0.10.x. Version
I do a downgrading but when I want to install an earlier version (0.10.32 and others)
npm unistall n
npm install n#0.10.32
I have the following errors:
C:\Users\Jeremy>npm install n#0.10.32
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "n#0.10.32"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! version not found: n#0.10.32
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jeremy\npm-debug.log
if your workflow does not involve global npm installs, etc, one approach is to simply use the node.exe executable as a stand-alone -- just grab the version you need from nodejs.org/dist and drop it into the working directory for a particular project. (Node.exe can run without actually 'installing' anything onto the system.)
then you could then specify the version of packages that you need for that version of node.exe like so: npm install foo#0.1.1.

Resources