Rails not detecting Node.JS - node.js

Im having an issue while trying to solving another one.
Im developping a Rails app on Windows 10, I run into the JavaScript issue that avoid Rails from working, a lot of people solve this issue by Installing Note.JS, some others change UTF-16LE to UTF-8 on routines.rb on ExecJS gem.
None of those solve my issue so I decide to force Rails using Node.JS instead of Windows default JScript by installing Node.JS (I tried with both x64 and x86 versions) and adding
ENV['EXECJS_RUNTIME'] = 'Node'
to my boot.rb ... this drive my into my second error by showing this message on rails server loading process:
There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Node.js (V8) runtime is not available on this system
I really appretiate your help! Im driving with those error for a while now and I feel kind of stuck now.

Related

NodeJS not recognized under Windows 10

I am using the LTS version of NodeJS. The problem started with version node-v16.18.0-x64 and did continue with node-v18.12.0-x64.
What I am doing:
Developing Playwright test. I ran the test and NodeJS was working. After one minute, I rerun the test and NodeJS is no longer recognized in my OS.
The issue appears when I am using Cypress, so I think the issue is not related to the technology that I am using.
I checked the environment variable: It is there.
The workaround I am doing is to uninstall the NodeJS from the control panel and install it again. There is an option to repair the NodeJS installation. But when I try to use it, I receive an error message that the NodeJS is not installed on this OS.

In the linked question, what does the op talk about regarding installing node.js in the working directory?

I am a complete newbie to all this.
I tried to install node.js 4 times and then again uninstalled it every time trying different things, thinking one of them would work.
The link to the question is-Cannot find runtime 'node' on PATH - Visual Studio Code and Node.js
After I typed $node --version in powershell terminal in VSCode (after installing node.js in C drive, defaulting to all recommended options in the setup) I get an error. I have uploaded the image of the error.
the error
Please tell me how to get node.js working with VSCode.
To get the version of Node, just type node --version in the terminal without the "$".

How to bundle a python server with pyinstaller for AppStore as 64bit only?

Context:
I am trying to put an electron app on the App Store. The app features a web frontend and a python backend. Nothing fancy so far.
The backend however features a separate server written in python. This server is a standalone application.
The electron app bundles the main app together with the python standalone server.
The problem:
When building the server as an executable I use pyinstaller on a python 3.5 development environment. Upon uploading to the AppStore I receive the following error:
1 package(s) were not uploaded because they had problems:
/var/folders/39/3v0phzy173s3qxkbxzvcpd5c0000gn/T/82AB662A-44C8-41E9-A213-8BF672F3DF10/1443777291.itmsp - Error Messages:
ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/AppKit._AppKit.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/AppKit._inlines.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/CoreFoundation._CoreFoundation.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/CoreFoundation._inlines.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/Foundation._Foundation.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/Foundation._inlines.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/PIL._imaging.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/PIL._imagingtk.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/PIL._webp.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libjpeg.9.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libopenjp2.2.1.0.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libtiff.5.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libwebp.7.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libwebpdemux.2.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libwebpmux.3.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libz.1.2.11.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/objc._objc.so)]'. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018."
We tried building the server using this:
pyinstaller server.spec --distpath ../app/app --noconfirm
It didn't work.
Another incantation I use to bundle the python server trying to force 64bit is:
arch -64 python ~/anaconda3/envs/shape/bin/pyinstaller server.spec -s --osx-bundle-identifier com.ShapeRobotics.FableMac --distpath ../app/app --noconfirm"
Why I'm sure it's the server:
I was successful in signing the app and getting it uploaded to the AppStore w/o the server packed in.
After packing in the server the 'i386' architecture error popped up.
Consequently my efforts so far have been focused to eliminate any shred of 32bit code in the server.
I assume that in order to do this I must properly configure the .spec file used by pyInstaller.
Does this make sense?
Is there a way to configure the spec file to force exclusive 64bit on anything bundled inside?
Is there some clear cut way to make the AppStore upload not vomit the 'i386' error?
Thank you!

How to load the .NET runtime as a node.js module?

I'm using the latest node.js for Windows x86.
I tried to use the node-sharp package from github.
It does compile, but when I load it into the node.js process (via require('./Sharp')),
The rather strange error: Error: no error, cannot load the module C:\path\to\module\Sharp.node occurs.
Has anyone also tried to use this library?
Actually, a better alternative is Edge.js, it is more stable and works now both on Linux and Windows

"Process out of memory" when running Node.js or NPM on Mac OSX 10.5

I am completely new to both Macs and Node.js, so sorry if this one is a bit basic.
I am running Mac OS X 10.5 (Leopard) and have just installed the last version of Node.js (released version, not built from source).
Whenever I attempt to run Node or do an NPM install, I get the following error message:
FATAL ERROR: CodeRange::GetNextAllocationBlock Allocation failed - process out of memory
Does anyone know what the problem is? If not, what would be the next steps to figure this out?
Edit: It turns out that if I run these commands a few times then they eventually work. So my work-around is to keep repeating the command until I get success. This is better than nothing but still not acceptable. Software like WebStorm, which needs to execute these tools, doesn't know about this workaround and fails all the time.
The issue seems to show up when running the distributed build of Node on anything pre OSX 10.6.
You can manually build the binary yourself if you don't have the option to upgrade your OS.
http://therobotsbrain.blogspot.com.au/2012/03/installing-nodejs-on-os-x-105.html
I'm running X.5.8, and node 0.10.13 was giving me this error message. I tried some earlier versions of node, and 0.10.3 works while 0.10.4 gets the error message. This is the x86 version, x64 seems to crash at .3 but works at .0. Oh wait, it's more complicated than that. Seems to make a difference when I make a symlink to the app in /usr/local/bin, it crashes. more often. Try a few different ones see which work for you.
I really need to get a new laptop.
download here: http://nodejs.org/dist/

Resources