Any npm's command is not working - windows

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

Related

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

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

I'm trying to install all npm modules in ../AppData/Roaming folder. But each time it fails with error code - 4068

I'm simply using the following command: "npm install -g". OS: Windows 8.1, CMD is administrator. Error log:
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 'install',
1 verbose cli '-g' ]
2 info using npm#2.5.1
3 info using node#v0.12.1
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec { raw: '.',
7 silly cache add scope: null,
7 silly cache add name: null,
7 silly cache add rawSpec: '.',
7 silly cache add spec: 'C:\',
7 silly cache add type: 'local' }
8 error addLocal Could not install C:\
9 verbose stack Error: EISDIR, read
9 verbose stack at Error (native)
10 verbose cwd C:\
11 error Windows_NT 6.3.9600
12 error argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g"
13 error node v0.12.1
14 error npm v2.5.1
15 error code EISDIR
16 error errno -4068
17 error EISDIR, read
18 error If you need help, you may report this error at:
18 error http://github.com/npm/npm/issues
19 verbose exit [ -4068, true ]
It appears as though you are running npm install -g from your C: drive. npm has absolutely no idea what you want it to install unless you:
pass it arguments, like how npm install -g npm will globally install npm
run it in a directory that contains a package
Since you are not passing the command any arguments, npm assumes you want it to install what is in your current working directory. Since you do not have a package at the root of your C: drive, npm correctly errors out with the EISDIR error ("error: is directory").

Issue in starting Node App on Windows 7

I am using windows 7 and I have installed node.js and express.
After I create a project using express using the command below
> express projectName
A new project is created and after that to install dependencies I do
> npm install
All works good so far. but when I try to start the application
> npm start
Below is the issue I get in the npm-debug.log file. Please suggest whats wrong here. I have tried many other threads but solution found there work for me.
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 'start' ]
2 info using npm#1.4.28
3 info using node#v0.10.33
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart NodeTestApp#0.0.0
7 info start NodeTestApp#0.0.0
8 verbose unsafe-perm in lifecycle true
9 info NodeTestApp#0.0.0 Failed to exec start script
10 error NodeTestApp#0.0.0 start: `node ./bin/www`
10 error spawn ENOENT
11 error Failed at the NodeTestApp#0.0.0 start script.
11 error This is most likely a problem with the NodeTestApp package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error node ./bin/www
11 error You can get their info via:
11 error npm owner ls NodeTestApp
11 error There is likely additional logging output above.
12 error System Windows_NT 6.1.7601
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error cwd C:\Users\Ali\Desktop\NodeTestApp
15 error node -v v0.10.33
16 error npm -v 1.4.28
17 error syscall spawn
18 error code ELIFECYCLE
19 error errno ENOENT
20 verbose exit [ 1, true ]
child_process.spawn() returns ENOENT when it can't find the requested executable; in this case, node.exe. Looking closely at the log, we can see that npm start is attempting to run node app.js.
Is node on your PATH? What happens if you just type node app.js on the command line?
Try this.It's working for me on Windows 7 32 bit node.js
Create new blank folder for your project.Go to your project folder and create manually npm folder (don't use command line).
Then try again create new project.
Hope this help.

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.

"npm faq" fails on Windows 7 ("spawn ENOENT" errors)

I have installed node.js on Windows 7 with their latest installer. It seemed to work, I can call npm and node from the console (either cmd or PowerShell), but I keep getting errors.
There are a lot of questions here about node.js on windows, but they all mention some specific piece of code. I'm getting the "spawn ENOENT" with a lot of simple commands, for instance yo, if I then pick "update generators" :
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
even npm faq fails :
PS E:\www\something> npm faq
npm ERR! Error: spawn ENOENT
npm ERR! at errnoException (child_process.js:988:11)
npm ERR! at Process.ChildProcess._handle.onexit (child_process.js:779:34)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/isaacs/npm/issues>
It seems that the problem is that node uses unix command names like dir, which do not exist on Windows. Some blog posts mention using Cygwin, but mostly for building node.js, not for calling it. The official nodejs website doesn't mention that cygwin is a prerequisite, either.
Here's the npm-debug.log :
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 'faq' ]
2 info using npm#1.3.24
3 info using node#v0.10.25
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 error Error: spawn ENOENT
5 error at errnoException (child_process.js:988:11)
5 error at Process.ChildProcess._handle.onexit (child_process.js:779:34)
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/isaacs/npm/issues>
7 error System Windows_NT 6.1.7601
8 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "faq"
9 error cwd E:\
10 error node -v v0.10.25
11 error npm -v 1.3.24
12 error syscall spawn
13 error code ENOENT
14 error errno ENOENT
15 verbose exit [ 1, true ]
Make sure that you have c:\Windows\System32 on your 'Path' System Variable. I was having this exact problem and this was the fix I needed. I must have taken it out in error sometime in the past.

Resources