nodejs: node-gyp rebuild - Access is denied - node.js

I am trying to install nodetime module to profile my nodejs app..
When i run > npm install nodetime
the files are downloaded. but when node-gyp rebuild runs.
I get the following error.
Command failed: CreateProcessW: Access is denied
The same thing happens, when i try to download v8-profiler.
Nodejs ver: 0.8.15
node-gyp: 0.7.1
I have tried this on both my dev machine that runs window 7 and on windows server 2008 where this app will be hosted..
Any help is appreciated. Please let me know if more explanation is required
Update:
Sorry I had ignored this post for a while.. Had a chat with someone I assume is the author of nodetime and here are the things required for nodetime to run on Windows.
Python version 2.7
If on windows the PATH environment variable for python should include python.exe Eg: C:\Python27\Python.exe
It requires CPP compilers that come with Visual C++ Express edition and Windows 7 64-bit SDK (SDK compiler is required for 64-bit version of nodejs).
Hope this helps.

Try just set PATH=C:\Python27;%PATH%
DO NOT set PYTHON variable (check that its not set on your machine).
I had incorrectly set the PYTHON variable some time ago - which then caused me this headache for ages until I managed to figure out what was wrong.

Related

NVM for Windows successfully installed but CMD prompt informs my version of Node.exe not compatible with my Windows version

I'm on a Microsoft Surface Pro X (it features Windows 10 Home on ARM 64-bit processor) trying to install Node.js. I've decided to use NVM for Windows. I can successfully install and get NVM for Windows running correctly. To my understanding, I'm able to install different versions of Node (i.e. 16.16.0 and 16.13.1, for example, both LTS) as shown in below graphic. But when I try to run Node, I get the error "This version of C:\Program Files\Nodejs\node.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher."
I am not clear on the why this is happening. Am I not downloading a version of Node that is compatible on my ARM 64-bit processor? I've read through several closed issues on the GitHub page but I haven't encountered someone bringing up this same error. I'm pretty confident it does NOT have to do with the integrity of my symlinks too, or my system environment variables. See below:
Your help and insight is appreciated. Thanks.

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 "$".

Electron throwing error %1 is not a valid win32 application with custom node addon

I've written a custom node addon that works perfectly fine when running the 64 bit version of Electron.
I tried setting the architecture to ia32 and everything builds, but I get the not valid win32 application error, no matter what I do.
My environment settings are:
npm_config_disturl=https://atom.io/download/atom-shell
set npm_config_target=1.0.1
set npm_config_arch=ia32
set npm_config_runtime=electron
set HOME="C:\Users\myHome\.electron-gyp"
set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
I have been building the addon by calling npm install.
Here's how I set my node to target 32 bit and install all packages in 32bit format. It works for me. You may try.
npm set npm_config_arch ia32
npm clean-install --arch=ia32
The first command set the node environment to 32bit.
The second command re-install all the node packages that are 32bit compatible.
I was trying to compile for windows from mi Mac and I had that problem too, but after some readings I figured out how to proceed, and after all I can say that I got it. Yesterday I spent all day setting up a windows virtual machine in my (other) Linux laptop (I used my linux laptop just because my mac was exhausted in storage...). I was having too a problem with the preloadScript from electron main process in windows, Cant found the script, it was solved too.
Anyway, I think the library node printer from #tojocky is well maintained, in other hand in the electron-builder documentation they say that you should compile in native for natural reasons. Once you will have it, you'll see that it's a cleaner and pragmatic solution ...
This was my entire process, I hope it helps to someone having the same issue:
Get VirtualBox (or Parallels but is not free)
Get iso for W10
Create a VM with this W10 iso, and you should give to this VM some storage (because some dependency that you'll need to compile), I have assigned 60gb to this VM
Once I had that VM running, I just installed in that machine Visual Studio 2017 (with their build-tools included, it's necessary)
And then, I used CMD to make the rest
Install NodeJS (and NPM, but it comes with)
Install node-gyp globally
Install Python 2.7
Clone your project from git (in my case)
npm i (in your project), you should have as npm dependency in your package.json the module electron-builder of course. (here I had some troubles because when node-gyp tried to rebuild printer to generate the binary for windows it was failing, this was because it was imposible to find the python executable, so if you face this problem you should add it like:npm config set python "c:\Python27\python.exe" in my case )
Then try again npm i and Voila!
After all, you should make the build using electron-builder, in my case my npm script command was build --win --x64 but you can use the --ia32 flag as well for 32bits

Oracle oracledb NPM module won't build with node-gyp and Windows

I've been trying to get the Oracle client for Node.js, oracledb, built on Windows 7. When I run npm install oracledb I see a large number of errors, such as:
fatal error C1083: Cannot open include file: 'oci.h'
fatal error C1083: Cannot open include file: 'oratypes.h'
As well as error messages like unrecognizable template declaration/definition and syntax error : 'using'.
I've been trying to build the oracledb client mostly with Node.js 5.8.0, but I've tried with older versions as well with the same result. My python version is 2.7.9. I've installed Microsoft Visual Studio 2015 Express, the newest available right now, as well as the Oracle InstantClient 12.1 (also current), but I still get pages of compiler errors from the node-gyp build process when running npm install oracledb.
This isn't the first NPM module I've had trouble building, and I've installed older versions of Visual Studio in the past (2010, 2012, 2013). I've tried uninstalling them as well, but I'm not convinced they actually uninstalled fully.
The bulk of the instructions that need to be followed for building oracledb for Node.js can be found here. But I'll sum up the key points as well as point out the extra bit of knowledge that made all the difference.
First you need to install Oracle InstantClient and SDK into the same folder. It's simplest, perhaps, if you rename and move that folder so that it becomes c:\oracle\instantclient. You can get the basic InstantClient and SDK from Oracle's site. Make sure that you download 64 bit versions if you are using 64 bit Node.js and 32 bit versions if you are using 32 bit Node.js.
If you didn't install the InstantClient into c:\oracle\instantclient, then you need this next step. Add the following environment variables to your system:
set OCI_LIB_DIR=C:\my-path-to-instantclient-here\sdk\lib\msvc
set OCI_INC_DIR=C:\my-path-to-instantclient-here\sdk\include
The commands above could be pasted into a command prompt to temporarily set the values, but you'd have to go into Control Panel > System > Advanced > Environment Variables to create new variables with the correct paths that match your installation to make the changes permanent.
Make sure that your Node.js, the Oracle InstantClient folder, and Python are all in your system's PATH environment variable.
Next download and install Visual Studio Express 2015 for Desktop.
Ensure that it, too, is in your PATH.
Here is the trick that saved me: If you have multiple versions of Visual Studio set, you need to tell node-gyp which one to use (in this case, 2015). To do that you have options.
1) You could create an environment variable named GYP_MSVS_VERSION and set its value to 2015.
2) You could also pass the 2015 value on the NPM command line like this:
npm install oracledb --save --msvs_version=2015
Or you could, and I find this to be the best method, set the version of Visual Studio that node-gyp should use globally with the following command:
npm config set msvs_version 2015 --global
You can then do a npm config list to verify that the config change took hold.
At that point you should be able to do a regular old npm install --save oracledb command and have it install and build in whichever project you like. Other compiled NPM modules should also build well now, too.

Installing Sails leads to Link.exe error in windows

I'm trying to install Sails.JS 0.11.0 to my Windows 7 laptop (intel cpu) but receive an error when npm tries to build it. The error is pasted at the end of this message.
I'm using Node 0.10.38 (required for my use of the OracleDB module, so I can't upgrade to version 12 yet).
My laptop has Visual Studio 2013 Express Desktop which is used to compile.
The Sails npm install completes using npm -g list sails, but with errors, so I worry it's not properly installed.
So far, I've reboot my computer, wiped its temp files, and did everything I can think of. Any suggestions? I can't find any compatibility info on the Sails site (maybe I need to install an older version of Sails?).
The link-cvtres.write.[ID].tlog file referenced below seems to exist in that directory (which is built on the fly)... at least, a version of the file with a "1" in place of the "[ID]" is there.
Any help is appreciated.
Error Message (in the red output):
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(607,5): error MSB6003: The specified task executable "link.exe" could not be run. C:\Users\me\AppData\Roaming
\npm\node_modules\sails\node_modules\sails-hook-sockets\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\build\Release\obj\validation\validation.tlo
g\link-cvtres.write.[ID].tlog [C:\Users\me\AppData\Roaming\npm\node_modules\sails\node_modules\sails-hook-sockets\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-cl
ient\node_modules\ws\build\validation.vcxproj]`

Resources