Error Node downgrading - node.js

I am a beginner in development, but I want to become a leading developer of mobile applications ;)
I am on Windows 8. I want to install Cordova but I have to downgrade Node I currently 0.12.x. Version I could see that he had to make a downgrade in 0.10.x. Version
I do a downgrading but when I want to install an earlier version (0.10.32 and others)
npm unistall n
npm install n#0.10.32
I have the following errors:
C:\Users\Jeremy>npm install n#0.10.32
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "n#0.10.32"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! version not found: n#0.10.32
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jeremy\npm-debug.log

if your workflow does not involve global npm installs, etc, one approach is to simply use the node.exe executable as a stand-alone -- just grab the version you need from nodejs.org/dist and drop it into the working directory for a particular project. (Node.exe can run without actually 'installing' anything onto the system.)
then you could then specify the version of packages that you need for that version of node.exe like so: npm install foo#0.1.1.

Related

my npm commands aren't working, npm is bugging?

C:\Users\jason\OneDrive\Documents\Web-Dev-Projects\pinterest-clone>npm install
npm ERR! Windows_NT 10.0.19042
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jason\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v14.17.6
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\jason\OneDrive\Documents\Web-Dev-Projects\pinterest-clone\npm-debug.log
I am getting this really annoying error that doesn't even tell me what's wrong with npm. I tried deleting and installing node.js again and running the command npm install but I would still get the error. I even tried running a command to use the latest version of npm and it still wouldn't work (npm install -g npm-windows-upgrade & npm-windows-upgrade).
It seems like npm is just being very buggy and doesn't want to work. Help please.
Based on this very similar issue, you really shouldn't be using npm 3.x with Node 14.
You might want to uninstall Node, ensure there are no traces of Node or npm on your system, then reinstall Node 14 or 16.
They automatically install newer versions of npm (6 or newer).
Also, the npm-windows-upgrade package you mention hasn't been updated in 3 years. Maybe don't use it?
You are definitely not running the latest version of the tools. NPM is in v7 and Node.js is in v16. Uninstall what you have currently installed, and download the latest version (make sure to choose Current not LTS) to install the latest version. Here is the link
I'd switch to a package manager specifically for managing different versions of Node + NPM side-by-side on your machine, which saves you the hassle of having to have 1 global installation that just "has to work" for all your projects.
Linux has nvm (node version manager). Since you're on Windows, you might want to check out the Windows-"fork": https://github.com/coreybutler/nvm-windows.
It should prevent incompatible versions of node and npm being installed together.

npm not working properly on windows 10

I have node.js installed via nvm, i have several versions and for some reason npm doesn't work on any of them. The versions are 4.5.0, 5.8.0 and 6.5.0 with their corresponding npm versions which i can't get because when i type npm -v
$ npm -v
[TypeError: Cannot read property 'readFileSync' of undefined]
And if i try to npm install on any project i get something similar to this (varies a little bit from project to project)
$ npm install
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.5.0
npm ERR! npm vTypeError: Cannot read property 'readFileSync' of undefined
npm ERR! Invalid Version: TypeError: Cannot read property 'readFileSync' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
|
npm ERR! Please include the following file with any support request:
npm ERR! C:\repos\bakeIn\npm-debug.log
I've tried uninstalling nvm and reinstalling it, also removing it completely and then getting a fresh install of node and npm (not via nvm) from their website, but i get the same result. I rebooted my machine just in case but no luck.
I haven't been able to find something helpful on google or here, or maybe I'm missing something.
In any case its like the fs module is not available to npm when it runs, it was working correctly a couple of days ago.
Thanks in advance for any help :)
In this particular case, doing a full scan for rootkits, spywares, virus, etc with different software's and cleaning what was found solved the issue. Not sure specifically what caused it but it was due to a program of that nature.

NPM Install Error - Node-Pre-Gyp

When I try to run npm-install I get:
npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files
(x86)\nodejs\node.exe" "C:\Program Files (x8
6)\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR!
node v4.0.0 npm ERR! npm v2.14.2 npm ERR! code ELIFECYCLE
npm ERR! v8-debug#0.4.6 install: node-pre-gyp install
--fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the v8-debug#0.4.6 install script 'node-pre-gyp install --fal
lback-to-build'. npm ERR! This is most likely a problem with the
v8-debug package, npm ERR! not with npm itself. npm ERR! Tell the
author that this fails on your system: npm ERR! node-pre-gyp
install --fallback-to-build npm ERR! You can get their info via: npm
ERR! npm owner ls v8-debug npm ERR! There is likely additional
logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:_Src\Personal\rzaleski\ILikeThis\npm-debug.log
I tried a number of things (installing VS C++ redistrib, npm install --msvs_version=2013, etc). Nothing seems to work.
Do you have any ideas how I can find out the actual error (the log is a bit daunting).
UPDATE: What I ended up doing was reverting from Node v4.0.0 to NODE v0.12. This is not really a fix to the issue, but it got me around my issues.
Go to: (http://www.devdocs.io) look # the npm section. Must use desktop, must use windows if possible (Mac layout is weird for some reason) Follow the steps detailed for "resetting npm cache"
Node-gyp is a P.I.T.A. and often blows up installs among other things. I have a horrible time with it every time I come back to an environment I haven't used in a while and try to use it again.
Alternatively, you can uninstall node, and attempt to reinstall using chocolatey if you're on windows or brew if you're on a mac. Make sure you sudo commands when installing to mac.
You're most likely going to have to clean out the npm cache, possibly reinstall nodejs, and possibly reinstall node-gyp.
NOTE: Before you go about the above mentioned steps, first make sure that your configurations are compatible, including your python version for node-gyp. (https://www.npmjs.com/package/node-gyp) Also, I have solved the C++ redistributable issues several times without touching anything C++ related, just so you know this error is not indicative of C++, but rather local settings and compatible software versions that interact with node + npm NOT C++ related (for instance, your python version interacting with node-gyp)
There is no straightforward "run this and that" to fix, you kind of have to muddle through it, and I can promise you that you'll have to do it more than once. But the more you fix node + npm + node-gyp, the more able you will be to quickly remedy all issues in the future. The links above should sort you out no problem though. Just walk through them slowly and thoroughly as instructed.
All i did is uninstall node and install it again, and during the installation, check the box telling you to install the needed dependencies and complete your installation.
If it persists, locate the package that is causing this error and install it seperately.
Example:
npm install -g node-gyp
npm install bcrypt

Error Installing laravel-elixir on windows: npm ERR! EEXIST, open '\AppData\Roaming\npm-cache\837c67b9-adable-s tream-1-0-33-package-tgz.lock'

I have a fresh installation of laravel 5.1. I followed these steps to Set up Elixir, Bootstrap, Font-awesome etc. When I run npm install it throws an error. I also tried using npm install --no-bin-links as the laravel elixir documentation suggests.
$ npm install --no-bin-links
npm WARN optional dep failed, continuing fsevents#0.3.8
npm WARN optional dep failed, continuing fsevents#0.3.8
> node-sass#3.2.0 install c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js
Binary downloaded and installed at c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node
> node-sass#3.2.0 postinstall c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js
` c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node ` exists.
testing binary.
Binary is fine; exiting.
npm ERR! EEXIST, open 'C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock'
File exists: C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock
Move it away, and try again.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--no-bin-links"
npm ERR! cwd c:\Users\user\PhpstormProjects\my_project
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0
I searched for the file (that exists) in the npm-cache directory and found there are no such file. But, when I execute the npm command it is created along with hundreds of LOCK file. I tried to delete the file during the installation process (which is quite tricky and seems impossible, because there are a lot of files created and removed simultaneously), which didn't help much. The error is not always the same. Most of the time it says 837c67b9-adable-stream-1-0-
33-package-tgz.lock file exists, some times it's just some other LOCK file.
I also tried updating npm to the latest release: npm -g install npm#latest (sauce)
What helped me on Win 8.1:
Install newest version of Python (3.5 at the moment) and make sure it's on your path (open some command line tool like power shell and enter 'py --version').
npm cache clear
In the laravel installation folder run: npm install --no-bin-links
I was also running power shell as an administrator when issuing the commands, but I'm not sure it matters (won't hurt in this case though).
I faced the same problem and run the terminal as administrator and it solved the problem.
I am not sure about you but issue but now the gulp is working :)

‘node-gyp rebuild’ installation error when adding a package to meteor app in Windows 7

I was trying to add a package (mizzao:turkserver) to my Meteor application, but I kept getting this error:
mizzao:turkserver: updating npm dependencies -- request, libxmljs,
validator, querystring, async, deepmerge...
gypnpm ERR! Windows_NT 6.1.7601
npm ERR! argv
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\\\node.exe"
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\node_modules\\npm\\bin\\npm-cli.js"
"install" "libxmljs#0.8.1"
npm ERR! node v0.10.36
npm ERR! npm v2.7.3
npm ERR! code ELIFECYCLE
npm ERR! libxmljs#0.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the libxmljs#0.8.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs 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 libxmljs
npm ERR! There is likely additional logging output above.
=> Babel active on file extensions: es6.js, es6, jsx
=> Errors while adding packages:
While building package mizzao:turkserver:
error: couldn't install npm package
I am developing my Meteor application on a Windows 7 machine and from what I have been able to gather from posts on forums, the error seems to be related to that fact (interaction between npm and Windows - I did not find any posts describing the same problem on Linux machines).
I've already tried installing the latest Python version and MS Visual Studio 2013 as suggested here: https://github.com/TooTallNate/node-gyp#installation, as well as setting some environment variables as suggested here: https://github.com/atom/atom/issues/2754. But none of those helped.
Any help would be greatly appreciated!
As I described in this comment, this seems to be an issue with the Python path being set incorrectly for npm, as Meteor's distribution of npm isn't hooking it up correctly. Most Linux distros come with Python, but Windows doesn't, so it is correlated with running Windows.
It can be fixed by making sure that Python is installed, then running the following command:
npm config set python C:\Python27\python.exe
The use of an old libxmljs is because mizzao:turkserver is dependent on a relatively old node MTurk API, which I'd like to wean it off of at some point, but isn't such a high priority at the moment.
See also:
https://github.com/lovell/sharp/issues/163
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

Resources