npm fails on windows 10 insider preview build 14366 - javascript

It seems that npm is broken (as well as the nodejs itself) on the new windows version build 1433
This is what happens when I ran
npm -v
events.js:141
throw er; // Unhandled 'error' event
^
Error: This socket is closed.
at WriteStream.Socket._writeGeneric (net.js:640:19)
at WriteStream.Socket._write (net.js:694:8)
at doWrite (_stream_writable.js:292:12)
at writeOrBuffer (_stream_writable.js:278:5)
at WriteStream.Writable.write (_stream_writable.js:207:11)
at WriteStream.Socket.write (net.js:618:40)
at WriteStream.stream.write (C:\Program Files\nodejs\node_modules\npm\node_m
at Cursor.write (C:\Program Files\nodejs\node_modules\npm\node_modules\npmlo
at Cursor.(anonymous function) [as show] (C:\Program Files\nodejs\node_modul
at Object.ProgressBar.hide (C:\Program Files\nodejs\node_modules\npm\node_mo
3.9.5
I've tried npm upgrade, but does not help much.
Are there any hotfix solutions or why this could happen?

From what I can see this is a known issue with some version of Windows 10: https://github.com/npm/npm/issues/12887. I find the proposed solution a bit weird - that the issue is presented only when you change the width of the console away from the default. You might give it a try. As it doesn't sound very plausible I am adding the github comment where I found it: https://github.com/npm/npm/issues/12887#issuecomment-222525339
Also running the command prompt in legacy mode seems to be another workaround.

Related

"spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell ENOENT" error while running npm start

When ever I try to execute npm start, this is what happens. I think there is some issue with powershell and not with npm because npm starts the development server. BTW I created basic react app using npx create-react-app. I checked, powershell file is there in the specified location and it is working as well. Guild me what should I do in order to resolve the error.
events.js:353
throw er; // Unhandled 'error' event
^
Error: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell',
path: 'C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell',
spawnargs: [
'-NoProfile',
'-NonInteractive',
'–ExecutionPolicy',
'Bypass',
'-EncodedCommand',
'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvAGwAbwBjAGEAbABoAG8AcwB0ADoAMwAwADAAMAAiAA=='
]
}
I faced with a same problem on Windows 10.
And solution was a pretty simple - just run your commands in git bush console.
Step 1:(reason of the error)
go to C:\Windows\System32\WindowsPowerShell\v1.0 and then you will not be found powershell.exe file that folder.
Step 2: (solution of the error)
download powershell.exe file online or just copy and paste this file in C:\Windows\System32\WindowsPowerShell\v1.0
https://www.exefiles.com/en/exe/powershell-exe/ - To download powershell.exe file online
So after trying everything and looking for the error on every possible website. I still wasn't able to resolve the error. Then I personally talked to someone regarding the error and he suggested me to run it in Windows Sub-system for Linux (WSL). I exactly did that and installed WSL with Linux 20.04 LTS. Now I am using Unix terminal to create the react app. It isn't the best solution for the problem, but yeah it does work and saves a lot of time!

when i am trying to run mupx deploy it is showing error

error in console
shubhabrata#shubhabrata-VirtualBox:~/Meteor/myapp$ mupx deploy
Meteor Up: Production Quality Meteor Deployments
Configuration file : mup.json
Settings file : settings.json
“ Checkout Kadira!
It's the best way to monitor performance of your app.
Visit: https://kadira.io/mup ”
Meteor app path : /home/shubhabrata/Meteor/myapp
Using buildOptions : {}
buffer.js:80
throw new Error(
^
Error: If encoding is specified then the first argument must be a string
at new Buffer (buffer.js:80:13)
at Readable. (/usr/lib/node_modules/mupx/node_modules/archiver/lib/util/index.js:32:15)
at emitNone (events.js:91:20)
at Readable.emit (events.js:188:7)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
Switching from node 7 to node 5.12 worked for me. I installed using nvm so that I can use later node versions in the future.
This occurred for me while using (deliberately) an old version of mup. It could well be that just upgrading mup will fix the problem.

Node-Inspector unable to open chrome browser throwing Error ENOENT

I would like to know why am I getting the following error when I try to debug node app using node inspector.
Debugger listening on port 5858
events.js:154
throw er; //unhandled 'error' event
Error: spawn C:\Users\Dell\AppData\Local\Google\Chrome\Application\Chrome.exe ENOENT
at exports._errnoException (util.js:890:11)
at Process.ChildProcess._handle.inexit(internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (node.js:383:13)
at process._tickCallback (node.js:407:11)
I believe this error was similar to the error reported at https://github.com/node-inspector/node-inspector/issues/732. But however I didn't get as new_chrome.exe.
Any help is appreciated
node version is 5.9.1
node debug version is 0.12.7
EDIT: Actually the problem is chrome.exe file is inside "Program Files(86)" , but while running node-debug it is searching in user folder. So it is something to do with node-module browser-launcher When I run detect.js, in browser-launcher2/examples , its returning me the correct chrome.exe path, but when I run launch.js, it is returning me the above error, since it was trying to find chrome.exe inside user folder. Any thoughts on this?
UPDATE: Added the temporary solution. It worked for me.
NOTE: This is a temporary solution. I am keeping this question open, so as to get a permanent solution for this error. Happy coding :)
I solved the above issue temporarily using James-Browser-Launcher module. Just install the module and run examples/launch.js in the terminal. Once launched, your default browser would open. Now run
node-debug
it launched the browser without error for me. Thats it. It would work now. Hope it works for you too
This works for me:
Go to C:\Users\youruser\ .config\browser-launcher2
open config.json
If there are more than two instances of Chrome, uninstall the error instance first and delete the error entry at file and his associated folder in this path. In my case, the error was Chrome Canary :
Example
And then, node-inspector works with Standar Chrome!!!

Meteor reset not working in vagrant

I'm trying to get meteor reset to work in vagrant box. However I kept getting errors. This is my error message:
/home/vagrant/.meteor/packages/meteor-tool/.1.1.10.8ogiso++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:278
throw(ex);
^ Error: EBUSY, rmdir '/vagrant/foosboom-meteor/.meteor/local'
at Object.Future.wait (/home/vagrant/.meteor/packages/meteor-tool/.1.1.10.8ogiso++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
at Object.rm_recursive (/tools/fs/files.js:270:9)
at Command.main.registerCommand.name [as func] (/tools/cli/commands.js:1211:9)
at /tools/cli/main.js:1378:23
I'm using hashicorp Otto as my development environment.
I have performed a mount on the local folder as suggested by one of the user here.
Any idea what seems to be the problem? Thanks.
After mounting you can't reset your mongo so do this
sudo umount -f /vagrant/foosboom-meteor/.meteor/local

Apache cordova ,Unable to create an app

This is the output , knowing that i'm running it under a proxy , and i specified the proxy settings.
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
then i run this command to create a new app in the specified folder "hello".
C:\>cordova create hello com.example.hello HelloWorld
Creating a new cordova project with name "HelloWorld" and id "com.example.hello"
at location "C:\hello"
Downloading cordova library for www...
this is the error :
Error: connect ETIMEDOUT
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
I recently had the same issue. I was maintaining an existing app and updating Cordova was well beyond the scope of the current task, so getting this working was really my only option.
Firstly, in order to eliminate all the errors and warnings about deprecated APIs when installing Cordova, I had to use some really ancient package managers. Using NVM I installed node 0.10.48 and npm 1.4.29. Cordova 3.6.3 then installed without any complaints.
But even creating an empty Cordova project wasn't possible as the below output shows:
Creating a new cordova project with name "HelloWorld" and id "com.example.hello" at location "~/Downloads"
Downloading cordova library for www...
Error: HTTP error 404 retrieving version 3.6.3 of cordova for www
at Request._callback (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/lazy_load.js:230:30)
at Request.self.callback (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:148:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:886:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:837:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:458:13)
Adding some extra debug output to lazy_load.js revealed that the CLI was looking for a directory at ~/.cordova/lib/www/cordova/3.6.3.
Since this was a brand new installation of Cordova, that directory obviously wasn't present so it went to download an archive from https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git;a=snapshot;h=3.6.3;sf=tgz but the archive that used to be there has apparently been removed. I found it at https://github.com/apache/cordova-app-hello-world/releases/tag/3.6.3.
I download that archive and extracted it to ~/.cordova/lib/www/cordova/3.6.3, and I was then able to create my template app.
I know this thread is old but I really hope this helps someone. Working with Cordova is a bitch at the best of times, let alone when vital online components are removed like this.
On OSX Yosemite even with sudo the error persists.
after digging a little bit more. i found the solution.
I have just run the cmd.exe as administrator. after that worked like magic.
I ran into this problem by not installing cordova as admin. I had to sudo npm install -g cordova to get the create command to work.

Categories

Resources