How to uninstall latest node & downgrade to old version [duplicate] - javascript

This question already has answers here:
Error: Cannot find module 'graphql/validation/rules/KnownArgumentNamesRule'
(6 answers)
Closed last year.
Error: Cannot find module 'graphql/validation/rules/KnownArgumentNamesRule' Require stack: - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\validate\preNormalization\tagDirective.js
C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\validate\preNormalization\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\validate\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\composeAndValidate.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\providers\schema\file.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\providers\schema\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\project\base.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\lib\commands\clie
nt\codegen.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\config\lib\plugin.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\config\lib\config.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\config\lib\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\command\lib\command.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\command\lib\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\bin\run Code: MODULE_NOT_FOUND
I face this issue while downloading schema in latest version of node, so i want to downgrade it to previous version.
Thanks

Open Terminal & run these command on macbook
cd /usr/local/include
sudo rm -R node
cd ../lib
sudo rm -R node_modules
cd ../bin
sudo rm -R node
**After that check node version if it's uninstall compeletely enter **
node -v
Result
"-bash: node: command not found"

You can use NVM(Node Version Manager).
**First Step **
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
Second Step
Install Specific Version Using NVM
nvm install <version>
if you are getting any error of nvm use below code
source ~/.nvm/nvm.sh
then again follow the second step
Third step
use this below command
nvm use <version>
then check the version
node -v

Related

Expo "Cannot find module 'color-convert'" Problem :(

I have problem! I just write terminal npm start and it shows:
Starting project at /home/pc/Documents/Projects/Mobile/weather_app
Developer tools running on http://localhost:19002
Cannot find module 'color-convert'
Require stack:
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/ansi-styles/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/chalk/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/#babel/code-frame/node_modules/#babel/highlight/lib/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/#babel/code-frame/lib/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/node-haste/DependencyGraph.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/Bundler.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/IncrementalBundler.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/index.js
- /usr/lib/node_modules/expo-cli/node_modules/#expo/dev-server/build/metro/importMetroFromProject.js
- /usr/lib/node_modules/expo-cli/node_modules/#expo/dev-server/build/HermesBundler.js
- /usr/lib/node_modules/expo-cli/node_modules/#expo/dev-server/build/MetroDevServer.js
- /usr/lib/node_modules/expo-cli/node_modules/xdl/build/start/startDevServerAsync.js
- /usr/lib/node_modules/expo-cli/node_modules/xdl/build/internal.js
- /usr/lib/node_modules/expo-cli/node_modules/xdl/build/index.js
- /usr/lib/node_modules/expo-cli/build/exp.js
- /usr/lib/node_modules/expo-cli/bin/expo.js
Please, help me fixing the problem!
npm version: 8.3.1
node version: v17.3.0
expo version: 5.2.0
I am not quite sure what might have caused your problem but you can try the following fixes and see if any of them works for you:
$ npm i color-convert to make sure you have installed the module color-convert.
$ expo r -c to clear cache and restart your app, it could be that your app has not updated that cache after installing the module color-convert.
You may also delete node-modules directory and run again npm i or yarn to download and all the modules and their correct dependencies.

Error: Cannot find module ‘/opt/Ferdi/resources/app.asar/node_modules/#meetfranz/theme/lib/index.js’

I’m collaborating with the programmers involved in the ferdi project.
https://getferdi.com/
Ferdi motto is :"All your messaging services in one place ". Infact it is like franz and it works on a lot of oses,such as mac os M1,windows,ubuntu x64 bit. And we are trying to make it work also on the arm64 / jetson nano / Tegra. Unfortunately on this os it does not work correctly because we have a javascript error that we aren’t able to fix. This is how to reproduce it :
[ `root#zi-desktop` ](mailto:root#zi-desktop) `:~/Desktop/zi/Work/I9/Virt/dockers/arm64/ferdi2# ferdi`
`[21980:0709/185715.104381:FATAL:electron_main_delegate.cc(252)] Running as root without --no-sandbox is not supported. See` [ `https://crbug.com/638180` ](https://crbug.com/638180) `.Trace/breakpoint trap`
[ `root#zi-desktop` ](mailto:root#zi-desktop) `:~/Desktop/zi/Work/I9/Virt/dockers/arm64/ferdi2# ferdi --no-sandbox`
`A JavaScript error occurred in the main processUncaught Exception:Error: Cannot find module` [ `'/opt/Ferdi/resources/app.asar/node_modules/#meetfranz` ](mailto:'/opt/Ferdi/resources/app.asar/node_modules/#meetfranz) `/theme/lib/index.js'.
Please verify that the package.json has a valid "main" entryat
tryPackage (internal/modules/cjs/loader.js:310:19)at
Function.Module._findPath (internal/modules/cjs/loader.js:523:18)at
Module._resolveFilename (internal/modules/cjs/loader.js:874:27)at
Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)at
Module._load (internal/modules/cjs/loader.js:732:27)at Function.f._load
(electron/js2c/asar_bundle.js:5:12913)`
(running as normal user gives the same error)
Basically we use a docker container like this to produce the deb packages that we will install on the os . Below u can see the Dockerfile for arm64 / tegra / jetson nano :
`FROM node:fermium-buster`
`LABEL Author="ZioMario <` [ `marietto2008#gmail.com` ](mailto:marietto2008#gmail.com) `>"`
`LABEL Title="arm64/ferdi"`
`# Enviorment variables`
`#ARG username=ferdi-arm64-builder`
`#ENV HOME /home/$username`
`ENV DEBIAN_FRONTEND=noninteractive`
`ENV LC_ALL=C.UTF-8`
`ENV LANG=C.UTF-8`
`ENV PATH="/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/lib:/usr/include:/usr/share"`
`#ENV HW="GPU"`
`#ENV TERM xterm`
`ENV USE_SYSTEM_FPM=true`
`ENV PREVAL_BUILD_INFO_PLACEHOLDERS=true`
`#RUN apt-get update && apt-get install -y ca-certificates curl netbase wget tzdata rpm git xz-utils nano gedit ruby gem`
`RUN apt-get update && apt install -y rpm ruby gem && gem install fpm --no-ri --no-rdoc --no-document`
`WORKDIR /ferdi`
`RUN git clone` [ `https://github.com/getferdi/ferdi.git` ](https://github.com/getferdi/ferdi.git) `. && git submodule update --init --recursive`
`RUN npx lerna bootstrap`
`RUN cd recipes && npm i && npm run package`
`RUN npm run build`
It is working everywhere,except on the jetson nano. do u have some ideas about how to fix it ? thanks.
In these cases usually try to delete the package-lock.json and node_modules, then try to run npm install again.
Also looks like you have a problem related to the "main" prop in package.json. The main property of a package.json is a direction to the entry point to the module that the package.json is describing.
For example in a Node.js application, when the module is called via a required statement, the module's exports from the file named in the main property will be what's returned to the Node.js application.

Tests not working anymore after updating to version < 24.0.0

Today, we've updated to the newest version of jest in our TypeScript project. We've included jest in our package.json of our project with"jest": "^24.7.1". We've also included "jest-when": "^2.4.0".
When we run now our tests, we get 1531 errors that jest wasn't found:
Cannot find name 'jest'.
Cannot find name 'expect'.
Cannot find name 'it'. Do you need to install type definitions for a test runner? Trynpm i #types/jestornpm i #types/mochaand then addjestormochato the types field in your tsconfig.
and much more.
We include jest in our spec's with import 'jest'; at the top.
Does anyone has an idea what could be the problem?
System:
OS: macOS 10.14.3
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU # 2.20GHz
Binaries:
Node: 11.10.1 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
npmPackages:
jest: ^24.7.1 => 24.7.1

node.js can't check version after installation on windows 10

I installed node.js version 4.4.1 on windows 10 and I tried to code with tutorial from internet. The first thing recommended was to write "$ node -v", but after that i'm getting following error:
You're already in the Node REPL, not in Windows' cmd (see the Node icon in the title bar?). You can directly write JS in that.
To get the version, run node -v on Windows' cmd.
you cant check node version inside node REPL to check the node version you need to exit Node REPL, ctrl+c x2 then type node -v or lunch cmd and type node -v

Need help with how to start using YUI YETI in Cygwin for JS testing

I'm new to a lot of things that YETI requires to run, and I've made it through most of the steps to get it to work. I have installed cygwin so I can run node.js and npm (I used these instructions). Once done, I ran npm install yeti, and yeti installed. Now I can type things like this:
This is where I'm having problems. I can't figure out how to get yeti to run the tests in demo.html. I can open up my browser to file:///C:/test/demo.html and I can see the tests run (it's a YUI Test) so I know that the problem is not demo.html being broken. Also, when I try to run yeti as a server (yeti --server), It sits there after the line "to run and report the results" and doesn't let me do anything unless I exit with ctrl-c, although I can go to localhost:8000 and see this:
If I try opening up a new cygwin console and doing this:
It gives me a bunch of errors that I don't understand.
Help!
How I did it on ubuntu:
First install node dependencies. Only install dependencies using apt-get
You need at least:
sudo apt-get install build-essential libssl-dev python2.6
Also this link could be helpfull => http://howtonode.org/how-to-install-nodejs (see ubuntu instructions).
Next install node/npm the correct way on ubuntu.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
close terminal and open it again
curl http://npmjs.org/install.sh | sh
After that install yeti issuing: $ npm install yeti#stable
Run yeti issuing from terminal:
alfred#alfred-laptop:~/node/stackoverflow/4833633$ yeti
Yeti will only serve files inside /home/alfred/node/stackoverflow/4833633
Visit http://localhost:8000, then run:
yeti
to run and report the results.
start the browsers you like. Point the browsers to => http://localhost:8000
inside the folder you started yeti write your tests.
alfred#alfred-laptop:~/node/stackoverflow/4833633$ ls -al
total 16
drwxr-xr-x 2 alfred alfred 4096 2011-01-29 01:47 .
drwxr-xr-x 6 alfred alfred 4096 2011-01-29 01:27 ..
-rw-r--r-- 1 alfred alfred 6140 2011-01-29 01:47 simple.html
See gist for a really simple example. I just copied to example from http://developer.yahoo.com/yui/3/examples/test/test-simple-example_clean.html but removed the <!--MyBlogLog instrumentation--> crap. I also told it not to render console by commenting line 196 => //r.render('#testLogger');(That last is not even necessary, but I think tests will run faster that way because it does need to render the console).
Finally I just ran:
alfred#alfred-laptop:~/node/stackoverflow/4833633$ yeti simple.html
Waiting for results. When you're done, hit Ctrl-C to exit.
✔ Example Suite on Chrome (8.0.552.237) / Linux
6 passed, 0 failed
✔ Example Suite on Firefox (3.6.13) / Linux
6 passed, 0 failed
Success :)
Some extra information about my distro
alfred#alfred-laptop:~/node/stackoverflow/4833633$ cat /etc/issue
Ubuntu 10.10 \n \l
alfred#alfred-laptop:~/node/stackoverflow/4833633$ python --version
Python 2.6.6
alfred#alfred-laptop:~/node/stackoverflow/4833633$ node -v
v0.2.6
alfred#alfred-laptop:~/node/stackoverflow/4833633$ npm -v
0.2.15
alfred#alfred-laptop:~/node/stackoverflow/4833633$ npm ls installed | grep yeti
npm info it worked if it ends with ok
npm info using npm#0.2.15
npm info using node#v0.2.6
yeti#0.1.2 The YUI Easy Testing Interface =reid active installed remote stable YUI web app YUITest TDD BDD yui3 test
npm ok

Categories