Titanium: ERROR | An uncaught exception was thrown! spawn C:\nodejs\node.exe - appcelerator

I am trying to run my sample program in appcelerator studio.
i have installed android SDK and node js .
C:\Program Files (x86)\nodejs\node.exe C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\alloy\bin\alloy compile F:\Appcelerator\simpleAlloy\app --config platform=android,version=0,simtype=none,devicefamily=none,deploytype=development,target=emulator --no-colors
2016-03-07T07:18:33.959Z | ERROR | An uncaught exception was thrown!
spawn C:\nodejs\node.exe
2016-03-07T07:18:33.959Z | ERROR | spawn C:\nodejs\node.exe
C:\Program Files (x86)\nodejs\node.exe ENOENT
2016-03-07T07:18:33.960Z | TRACE | Error: spawn C:\nodejs\node.exe
C:\Program Files (x86)\nodejs\node.exe ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
---------------------------------------------
at ChildProcess.spawn (internal/child_process.js:281:13)
at exports.spawn (child_process.js:362:9)
at F:\Appcelerator\simpleAlloy\plugins\ti.alloy\hooks\alloy.js:161:14
at C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\node-appc\lib\async.js:46:6
at C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:697:13
at C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:52:16
at done (C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:248:21)
at C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:44:16
at C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:694:17
---------------------------------------------
at Object.exports.execFile (child_process.js:296:9)
at exports.exec (child_process.js:111:18)
at F:\Appcelerator\simpleAlloy\plugins\ti.alloy\hooks\alloy.js:99:7
at C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:689:13
at C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:239:13
at _arrayEach (C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:91:13)
at _each (C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:82:13)
at async.forEachOf.async.eachOf (C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:238:9)
at _parallel (C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\titanium\node_modules\async\lib\async.js:688:9)
C:\Program Files (x86)\nodejs\node.exe ENOENT
But i have node installed in SDK as well seperately in my system.

Read this below url first,
http://docs.appcelerator.com/titanium/3.0/#!/guide/Software_Locations_and_Environment_Variables-section-29004844_SoftwareLocationsandEnvironmentVariables-WindowsSoftwareLocations
–> This url contains environment variables setup for titanium applications.
–> Check all environment variables (ex: path) correctly set or not.
–> After setting all environment variables correctly, Restart the studio and rebuild.
Thanks.

I resolved the issue for me by removing one of the versions of nodejs. I had two versions installed. Win 8.1. By the way, I managed to run the command
C:\Program Files (x86)\nodejs\node.exe C:\Users\apanditi\.appcelerator\install\5.2.0\package\node_modules\alloy\bin\alloy compile F:\Appcelerator\simpleAlloy\app --config platform=android,version=0,simtype=none,devicefamily=none,deploytype=development,target=emulator --no-colors
successfully in a separate cmd window during occuring this error in appcelerator studio

You don't need to uninstall one of the versions, actually you just have to look at the PC environment variables and just remove node from path! It might look strange but it indeed solved the spawn ENOENT problem. It happened to me when I installed Platino Studio 1.1 which uses older Node.js version.
so you can keep both versions installed the 4.0 and the 0.12.7 but just remove their path instance from pc environment variables.
my pc os is windows 10

Related

adding npm packages to windows

I have installed node and npm onto my computer without a problem (I am running windows 8) however this is my first time using windows and I cant seem to access any packages I install without getting an error message Could not find files for the given I should also mention im working in visual studios on a .net and angular project, the node is just for testing.
where node gives me C:\Program Files\nodejs\node.exe
where npm gives me C:\Program Files\nodejs\npm.cmd
but I know the karma package I installed went to C:\Users\Admin\AppData\Roaming\npm\node_modules I have added a NODE_PATH to my environment variables but it didnt help. Any thoughts?
this is a snippet from command prompt:
C:\Users\Admin\AppData\Roaming\npm\node_modules>dir
Volume in drive C is 000000
Volume Serial Number is 000000
Directory of C:\Users\Admin\AppData\Roaming\npm\node_modules
2015-01-05 06:39 PM <DIR> .
2015-01-05 06:39 PM <DIR> ..
2015-01-05 06:39 PM <DIR> karma
2015-01-05 06:39 PM <DIR> karma-cli
0 File(s) 0 bytes
4 Dir(s) 918,342,209,536 bytes free
C:\Users\Admin\AppData\Roaming\npm\node_modules>where karma
INFO: Could not find files for the given pattern(s).
C:\Users\Admin\AppData\Roaming\npm\node_modules>
Are you trying to use the command-line command karma or require() the package in a module? You need to install packages differently for these use cases.
> npm install -g karma
Will install the karma package globally, and it should then be accessible from your command line. You may need to close and re-open your command prompt or re-set the PATH environment var.
If you want to use the package with require, you will need to create a package directory, run npm init, and then install karma locally with npm install --save karma. This will install the package under the node_modules directory for that package only. npm does this to avoid conflicts between different packages which may require different versions of the same package.
Please forgive me if I am misunderstanding your question.

Any npm's command is not working

I can attach the error log file
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\\node.exe',
1 verbose cli 'C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'config' ]
2 info using npm#1.4.28
3 info using node#v0.10.35
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 error Error: ENOENT, stat 'c:\'C:\Program'
6 error If you need help, you may report this entire log,
6 error including the npm and node versions, at:
6 error http://github.com/npm/npm/issues
7 error System Windows_NT 6.2.9200
8 error command "C:\Program Files\nodejs\\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "config"
9 error cwd c:\
10 error node -v v0.10.35
11 error npm -v 1.4.28
12 error path c:\'C:\Program
13 error code ENOENT
14 error errno 34
15 verbose exit [ 34, true ]
Any npm's command is not working.
I am using windows 8.1 and I installed npm successfully.
I heard that ENOENT error can be fixed if I make a folder relate to the error path but
error path contains 'C:\Program, I cannot make that file.
How can I solve this problem? I tried to uninstall npm, I failed.
This problem happened because I tried to change prefix for npm but something goes wrong
I found way to fix it.
OK, the reason why this problem happened was that I usually use CMD with administrator's admission.
Because of that setting, actually, I don't need to change prefix of npm but I just want to practice what I learn in my current book.
So I tried to change prefix but accidentally, Using
npm config set prefix C:\program files
I changed the prefix 'C:\program' like this.
because of special character : , I cannot create name of fold including : .
because of damn prefix, npm was totally not working.
I searched npm folder, I found npmrc file but it did not help.
Finally, I found .npmrc at C:\Users\myName .
there, the prefix was setted at C:\program .
I delete prefix and Now it is working!!!!!
Bye Bye let's master nodejs

Node.js failed to install global npm packages on windows (not path)

So, I have a strange problem that I'm not even sure I can identify. I just installed the current version of Node.js (v.10.*) on my Windows 7 machine. I have tried to install a couple packages globally (gulp and yoeman), but I get errors when they are installing and in my C:\Users\Michael\AppData\Roaming\npm\node_modules directory, many of the package files are missing. Obviously, when I try to run the command globally, it fails because there IS NO command. It was never created.
Some other globally installed packages work fine (bower and grunt).
To make things really tricky. When I install gulp to a local folder (without the -g), the install works perfectly and I can use gulp by prepending the entire path before the command. Obviously, I could add that path to my system properties so the command would be global, but that wouldn't really fix my problem. Why does the install produce errors when installing globally, but not when installing locally?
As I watch the directory while gulp is installing locally, I see the files being created. Then the first error comes along and many of the files are deleted.
I believe the relevent parts of the log for my gulp install are:
6949 verbose lock lodash.noop#2.4.1 C:\Users\Michael\AppData\Roaming\npm-cache\7e62c2bb-lodash-noop-2-4-1.lock
6950 error Error: ENOENT, lstat 'C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool'
6951 error If you need help, you may report this *entire* log,
6951 error including the npm and node versions, at:
6951 error <http://github.com/npm/npm/issues>
6952 error System Windows_NT 6.1.7601
6953 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "gulp"
6954 error cwd c:\wamp\www\phoenix\animus\gulp
6955 error node -v v0.10.28
6956 error npm -v 1.4.9
6957 error path C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6958 error fstream_path C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6959 error fstream_unc_path \\?\C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6960 error fstream_type Directory
6961 error fstream_class DirWriter
6962 error code ENOENT
6963 error errno 34
6964 error fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
6964 error fstream_stack Object.oncomplete (fs.js:107:15)
6965 verbose exit [ 34, true ]
I have log files if that would help.
Thank you.
Windows can only support 260 characters as Max Path Length. I hope nodejs developers will resolve the nesting module approach. To do a workaround I simply change the global npm modules path to c: from AppData to get some characters and it resolves the issue. I know that this hack just provide you few characters but it is working for me.
To do so,
Open notepad in Administrator mode.
Go to location [nodejs installation directory]\node_modules\npm
Open file "npmrc" and change prefix=c:\npm
Save the file.

Error after running build() to create R package in RStudio

I am trying to build an R package using RStudio on Windows 8 Pro. When I attempt to build the package by running build() I get the error:
"C:/Program Files/R/R-30~1.2/bin/x64/R" --vanilla CMD build "H:\File Assembly\FileAssembler" \
--no-manual --no-resave-data
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
Error: Command failed (1)
I already have MiKTEX installed and I have checked this by:
Sys.which("pdflatex")
pdflatex
"C:\\Program Files (x86)\\MIKTEX~1.9\\miktex\\bin\\pdflatex.exe"
The R version I am using is: R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Loading library(devtools) and running find_rtools(T) gives:
find_rtools(T)
Scanning path...
ls : c:\Rtools\bin\ls.exe
gcc: c:\Rtools\GCC-46~1.3\bin\gcc.exe
VERSION.txt
Rtools version 3.1.0.1942
Version: 3.1
[1] TRUE
In addition, the path for rtools exes are:
Sys.which("ls.exe")
ls.exe
"c:\\Rtools\\bin\\ls.exe"
Sys.which("gcc.exe")
gcc.exe
"c:\\Rtools\\GCC-46~1.3\\bin\\gcc.exe"
And checking the path in R:
Sys.getenv('PATH')
[1] "C:\\Program Files\\R\\R-3.0.2\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\gcc-4.6.3\\bin;……other paths…………;C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\"
I would really appreciate help with identifying what I have missed out.
This is a common error caused by a space in the install location path (C:\Program Files). The solution, and the official R recommendation is that you never install R in a location with spaces in it on Windows if you want to be able to install packages from source.
from http://cran.r-project.org/bin/windows/rw-FAQ.html#How-do-I-install-R-for-Windows_003f:
If you want to be able to build packages from sources, we recommend
that you choose an installation path not containing spaces.
I had the same problem.
Took some time to find that Rcmd.exe was removed by the Kaspersky antivirus.
once I detected that it was easy to fix.
good luck
Offer

"cannot find module" when installing npm modules on windows

I am new to NodeJS. I am trying to use npm on Windows 8.
I have installed using chocolatey, cinst nodejs.install (version 0.10.17). I installed as administrator (and would prefer to run npm as a normal user).
Node itself seems to be working, I can use the REPL to run simple programs.
If I try to install something using npm, I get cannot find module:
> node npm install express
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\Klas\Documents\My Dropbox\mina egna\tech\node\webserver\npm'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
I have read the answers on Nodejs cannot find installed module on Windows? but unfortunately it is still unclear to me what I have to do.
I have tried setting NODE_PATH:
In trying to follow this answer, I have tried setting it to C:\Users\Klas\AppData\Roaming\npm\node_modules (but I had to create both the npm and the subfolder node_modules myself)
I have tried creating a folder c:\node\node_module (according to this advice, even though the installation did not even create a c:\node folder) and setting it to that.
I have tried setting it to C:\Program Files\nodejs\node_modules\npm\node_modules (which did exist after installation)
I have also tried to create a node_modules folder below the current working directory. As I understand it that is where local npm will be installed?
None of these helped. So it seems to me that setting NODE_PATH is not the solution?
Using the -g flag makes no difference (I would prefer not to use it).
I get the same error both as normal user and as administrator (I would prefer to be a normal user).
I get the same error no matter where I execute the command, except when I do it in C:\Program Files\nodejs, where I get
basedir=`dirname "$0"`
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
Not using windows, but I'm pretty sure it's just npm install express on windows too.

Resources