Unable to install formidable in node js - javascript

This may sound like a duplicate question, but, believe me, it's not. I couldn't find any source detailing the same error and how to remedy it:
C:\Users\admin\Desktop\nodejsfiles>npm install formidable
npm http GET https://registry.npmjs.org/formidable
npm ERR! Error: failed to fetch from registry: formidable
npm ERR! at C:\Program Files\nodejs\node_modules\npm\lib\utils\npm-registry-
client\get.js:139:12
npm ERR! at cb (C:\Program Files\nodejs\node_modules\npm\lib\utils\npm-regis
try-client\request.js:32:9)
npm ERR! at Request._callback (C:\Program Files\nodejs\node_modules\npm\lib\
utils\npm-registry-client\request.js:137:18)
npm ERR! at Request.callback (C:\Program Files\nodejs\node_modules\npm\node_
modules\request\main.js:109:22)
npm ERR! at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\main.js:198:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\
npm\node_modules\request\main.js:356:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1258:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "formidable"
npm ERR! cwd C:\Users\admin\Desktop\nodejsfiles
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.0-3
npm ERR! message failed to fetch from registry: formidable
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\admin\Desktop\nodejsfiles\npm-debug.log
npm not ok

Seems like this works
npm config set registry http://registry.npmjs.org/
Quoted from "message failed to fetch from registry" while trying to install any module
Anyway I recommend updating to latest versions of nodejs and npm.

Related

npm install not working, can't install any of the node modules after cloning my project from git

I have cloned my project from git and when trying to do the npm install, it's not working.
I can't fix any of the errors - for example when trying to fix the core-js error with npm install --save core-js#^3 I still get the same message, that I need to upgrade.
Why is this happening? there were no errors before I cloned this repo?
npm WARN deprecated #babel/polyfill#7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the #babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated core-js#2.6.12: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm ERR! code 1
npm ERR! path C:\Users\User\Desktop\mydailyprep\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#14.16.1 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:308:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! gyp ERR! System Windows_NT 10.0.17134
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\Desktop\\myapp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\User\Desktop\mydailyprep\node_modules\node-sass
npm ERR! gyp ERR! node -v v14.16.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2021-04-09T10_33_10_047Z-debug.log
Try :
npm cache clean --force
npm install
Even I faced same kind of issue... might be this may be helpful to you.. :)
I have created a folder called "projects (Folder Name)" in that I have taken the clone of my project - called "xyz project (projects >> xyz project)"..
now by mistake I tried to install - npm install in "projects folder (parent folder)"..
but node modules have to be installed in "xyz project" (child folder)
So when I have used npm i... in xyz project... then node modules have installed SUCCESSFULLY..
Try this..

WebStorm 8, install grunt

Can't install Grunt package in WebStorm 8:
Install packages failed: Error occurred when installing package grunt.
Log:
Install packages failed: Error occurred when installing package grunt.
"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" install grunt
Exit code: 1
Standard error:
npm ERR! Error: Invalid version: "0.1"
npm ERR! at Object.module.exports.fixVersionField (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\node_modules\normalize-package-data\lib\fixer.js:183:13)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\node_modules\normalize-package-data\lib\normalize.js:30:38
npm ERR! at Array.forEach (native)
npm ERR! at normalize (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\node_modules\normalize-package-data\lib\normalize.js:29:15)
npm ERR! at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:342:33)
npm ERR! at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:126:33)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:328:57
npm ERR! at fs.js:207:20
npm ERR! at OpenReq.Req.done (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:144:5)
npm ERR! at OpenReq.done (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:64:22)
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/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "grunt"
npm ERR! cwd C:\Users\ID25\Desktop\untitled1
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm`
please, help me!!!
Please check your package.json - what is the "version" value? '0.1' is not a valid value, as it doesn't conform to the versioning scheme (http://semver.org/) npm packages uses. see https://www.npmjs.org/doc/json.html

nodejs npm install error, how to correct?

I am trying to do npm install on a project that requires 'ref' and I get this error. Any idea how can I correct this?
I have nvm runnning and node -v = 0.10.26
ref#0.1.3 install /root/node-ffi-libvirt/nodejs-usage/ffi-libvirt/node_modules/ref
node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES, mkdir '/root/node-ffi-libvirt/nodejs-usage/ffi-libvirt/node_modules/ref/build'
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/node-ffi-libvirt/nodejs-usage/ffi-libvirt/node_modules/ref
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! ref#0.1.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ref#0.1.3 install script.
npm ERR! This is most likely a problem with the ref package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls ref
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "node" "/root/.nvm/v0.10.26/bin/npm" "install" "ref"
npm ERR! cwd /root/node-ffi-libvirt/nodejs-usage/ffi-libvirt
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
This suggests you don't have permission to create a directory.
It looks like the original project was installed as root (implied by the /root in the path) - so you must run the install as root as well.
try mkdir '/root/node-ffi-libvirt/nodejs-usage/ffi-libvirt/node_modules/ref/build' with the user you are running the command from. Fix that first and then run your command.

npm formidable install - getting errror

trying to install formidable JS library but having some install trouble,
it seems like https://registry.npmjs.org/formidable is down, and using isup.me, the registry site seems to be down completely = can anyone else confirm this as the problem or is it something that I am doing wrong on my side?
THanks! here is the error log from console
^C[~/Documents/Projects/moocs/starup engnineering/nodetutorial]$npm install formidable
npm http GET https://registry.npmjs.org/formidable
npm http GET https://registry.npmjs.org/formidable
npm http GET https://registry.npmjs.org/formidable
npm ERR! Error: connect ECONNREFUSED
npm ERR! at errnoException (net.js:878:11)
npm ERR! at Object.afterConnect [as oncomplete] (net.js:869:19)
npm ERR! { [Error: connect ECONNREFUSED]
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! syscall: 'connect' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'
npm ERR! System Darwin 12.4.0
npm ERR! command "/usr/local/Cellar/node/0.10.3/bin/node" "/usr/local/bin/npm" "install" "formidable"
npm ERR! cwd /Users/TheGiantSpider/Documents/Projects/moocs/starup engnineering/nodetutorial
npm ERR! node -v v0.10.3
npm ERR! npm -v 1.2.17
npm ERR! syscall connect
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! stack Error: connect ECONNREFUSED
npm ERR! stack at errnoException (net.js:878:11)
npm ERR! stack at Object.afterConnect [as oncomplete] (net.js:869:19)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/TheGiantSpider/Documents/Projects/moocs/starup engnineering/nodetutorial/npm-debug.log
npm ERR! not ok code 0
Try this:
npm config set registry="http://registry.npmjs.org/"
It worked for me.

NPM no longer working

so I wasn't paying attention and ran this command-
npm install npm install jasmine-node -g
which caused this -
npm http GET https://registry.npmjs.org/install
npm http GET https://registry.npmjs.org/jasmine-node
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/install
npm http GET https://registry.npmjs.org/install/-/install-0.1.7.tgz
npm http 200 https://registry.npmjs.org/install/-/install-0.1.7.tgz
npm http 200 https://registry.npmjs.org/jasmine-node
npm http GET https://registry.npmjs.org/jasmine-node/-/jasmine-node-1.4.0.tgz
npm http 200 https://registry.npmjs.org/jasmine-node/-/jasmine-node-1.4.0.tgz
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-1.2.15.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.2.15.tgz
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/install'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/install']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/install',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/install',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ 'DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:297:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "npm" "install" "jasmine-node" "-g"
npm ERR! cwd /Users/psanker/Google Drive/Coding/Javascript/WhatsGoingOn
npm ERR! node -v v0.8.17
npm ERR! npm -v 1.2.0
npm ERR! path /usr/local/lib/node_modules/install
npm ERR! fstream_path /usr/local/lib/node_modules/install
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/install'
npm ERR! fstream_stack DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/jasmine-node'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/jasmine-node']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/jasmine-node',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/jasmine-node',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ 'DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:297:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "npm" "install" "jasmine-node" "-g"
npm ERR! cwd /Users/psanker/Google Drive/Coding/Javascript/WhatsGoingOn
npm ERR! node -v v0.8.17
npm ERR! npm -v 1.2.0
npm ERR! path /usr/local/lib/node_modules/jasmine-node
npm ERR! fstream_path /usr/local/lib/node_modules/jasmine-node
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/jasmine-node'
npm ERR! fstream_stack DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! error rolling back npm#1.2.15 { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/npm' }
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "npm" "install" "jasmine-node" "-g"
npm ERR! cwd /Users/psanker/Google Drive/Coding/Javascript/WhatsGoingOn
npm ERR! node -v v0.8.17
npm ERR! npm -v 1.2.0
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/psanker/Google Drive/Coding/Javascript/WhatsGoingOn/npm-debug.log
npm ERR! not ok code 0
Now when I try and run
npm install jasmine-node -g
I get
-bash: /usr/local/bin/npm: No such file or directory
What's going on?
When you run npm install -g somepackage, you may get an EACCES error asking you to run the command again as root/Administrator. It's a permissions issue.
It's easy to fix, open your terminal (Applications > Utilities > Terminal)
sudo chown -R $USER /usr/local
** I strongly recommend you to not use the package management with sudo (sudo npm -g install something), because you can get some issues later **
Reference: http://foohack.com/2010/08/intro-to-npm/
** Update **
The reason is because this can cause permissions problems with lots of other apps, so I'd suggest not doing this.
A better solution when you are installing globally:
sudo chown -R `whoami` ~/.npm
Tried it myself.
You will need to install npm again. If you use git, this is the easiest way:
git clone http://github.com/isaacs/npm.git
cd npm
sudo make install
Otherwise, there is an install script too:
curl http://npmjs.org/install.sh | sh
(possibly you will need to use sudo sh instead of sh).
Then install your module again:
sudo npm install jasmine-node -g
EDIT 23/01/2014:
Now npm comes with NodeJs itself, so just reinstall NodeJs.
Look at the error
Please try running this command again as root/Administrator.
You need to run this with sudo
$ sudo npm install jasmine-node -g
This worked for me (OSX). I had to run it in my user directory.
cd ~
curl -L http://npmjs.org/install.sh | sudo sh
I was able to get around the permissions issues by setting my packages to install locally with a one-line "$HOME/.npmrc" file:
prefix=${HOME}/.npm_packages

Categories

Resources