I have apparently removed nodejs from my machine using this command:
sudo apt-get purge --auto-remove nodejs && sudo apt-get purge --auto-remove npm
But Playwright still manages to work, so does it come with a built-in Node installation or something ? If yes, where can I get the path of its Node ?
Note that I'm using Playwright for Go.
Related
I tried to create react app with node version 12.1.0 but it warned me that my minimum node version should be at least 14.0. I used nvm to change my node version to 14.0 and created react app.
However, I want to use my app on node version 12.1.0. So I changed to node version v12.1.0 but I got:
"ERROR in Module.createRequire is not a function" error. Also " ERROR
in Error: Child compilation failed: Module.createRequire is not a
function "
As we can read in official docs:
Create React App
Create React App is a comfortable environment for learning React, and
is the best way to start building a new single-page application in
React.
It sets up your development environment so that you can use the latest
JavaScript features, provides a nice developer experience, and
optimizes your app for production. You’ll need to have Node >= 14.0.0
and npm >= 5.6 on your machine.
So these are requirements that you must meet and it seems that it cannot be avoided that way .
Use 14+ of node.js version
just use nvm -version_name
Try completely updating the newest, stable version of both nodejs and npm:
sudo apt -y update && sudo apt -y upgrade
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt -y update && sudo apt -y upgrade
sudo apt -y autoremove
Then, change directories into your app directory:
cd myapp/ #Change this to match your app directory
Remove node_modules folder
sudo rm -rf node_modules/
Then reinstall the packages:
npm i
See if your app builds successfully:
npm run build
I got this error with an app created with create-react-app v5.0.0, when I was using node v16 (via nvm). Downgrading the project to node 14.18.12 fixed the issue for me (I also deleted node_modules and ran npm install again).
I encountered this while using Eslint.
Upon running, npm run lint, the error appeared.
I have various Node versions on my dev machine and I noticed that I had run the command using v10.
When I switched to v16, the command worked.
Cause of the error:
Using incompatible Node versions.
Solution
Change Node.js versions (I use Node Version Manager - nvm to do this).
Now node 19.x is released and the 18.x is the recommended version
if you want to upgrade your node version, simply you can change this line
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
to
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
and
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
for latest version
You can try
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs
https://github.com/nodesource/distributions/blob/master/README.md#debinstall
I tried to update nodejs using the following:
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
I have always successfully used this to update nodejs, however, the update failed this time. Now, whenever I run NPM or nodejs, I get a segmentation fault.
I tried uninstalling NPM and nodejs using many variations of:
sudo apt-get remove --purge npm
sudo apt-get remove --purge nodejs
sudo apt-get remove --purge node
And reinstalling them.
However, they never seem to uninstall. Whenever I type NPM or node, it says permission denied. When I use sudo, I get a segmentation fault.
$ which npm results in /usr/local/bin/npm
and I get similar results with nodejs.
Is there a simple way to fix this? I'm very leery about manually removing packages. I've tried this on a personal machine in the past and messed up the package manager so badly that I had no choice but to reinstall Ubuntu. I would like to avoid doing that since this is on a development server.
The node binary was corrupt and Ubuntu was unable to unstall/uninstall node using the apt package manager. To solve this issue I just copied the node 12.13.0 binary file from another machine into /usr/local/bin on this machine. Now node and all node related modules (such as npm) work perfectly fine.
i had same problem , and simply fix it by :
apt update
then
apt upgrade
- HOPE THIS HELP -
just remove nodejs, use
sudo apt-get remove nodejs
then go to /usr/local/bin and remove node, nodejs npm if exists:
sudo rm nodejs
sudo rm npm
sudo rm node
reinstall nodejs with this link https://computingforgeeks.com/install-latest-node-js-and-npm-on-ubuntu-debian/
I tried these two commands to uninstall node js but I am not able to do it.
sudo apt-get purge nodejs
sudo apt-get autoremove
when I check for version, it shows
v9.3.0
And I want to install node 8.x
I got the same problem.
Step 1: Find the node location using
rails#rails-All-Series:~$ whereis node
node: /usr/local/bin/node
Step2: Remove node module from these the location.
rails#rails-All-Series:/usr/local/bin$sudo rm -rf node
Below mentioned link specifies how to delete node package from ubuntu
sudo apt-get purge nodejs
it will only be purging related nodejs packages
Other Alternative will be:
sudo apt-get purge --auto-remove nodejs
it will be implementing the below mentioned commands internally:
sudo apt-get purge nodejs
sudo apt-get autoremove
autoremove will actually be removing the related package and they were installed as a dependency module .
node -v and nodejs -v shows different versions
My node -v shows
4.2 version
and nodejs -v
shows 6.10.3
So what should be the issue?
I want node -v to show 6.10.3.
I also had the same problem, and I solved this by doing the following steps.
Step 1: completely remove node and node js from system
sudo apt-get remove nodejs sudo apt-get remove npm
Then go to /etc/apt/sources.list.d and remove any node list if you have. Then update system cache by running
sudo apt-get update
Step2: Installing Specific version of node (I am using node version 8)
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt install nodejs
Now If you see node -v and nodejs -v, you get both the versions are same as
v8.14.0
i also face this problem
i tried this
1) sudo apt-get remove nodejs sudo apt-get remove npm
remove cache from /etc/apt/sources.list.d
2)sudo apt-get update
then install again nodejs
3)sudo apt install nodejs
I think you have installed both nodejs and nodejs-legacy packages. So just remove one of them. nodejs-legacy is v.4.x and nodejs is v.6.x
apt-get remove nodejs-legacy
If it says there is no "nodejs-legacy" try
sudo apt-get remove nodejs
And you will see it in the list when it asks you if you are sure about uninstalling.
Hi i am having a ubuntu server which will not have any internet connection. I need to install node and all npm related packages to it.I have the source file of nodejs and all the node modules. Is there any way to install the build essential package and the python dependencies without using the below code
sudo apt-get update
sudo apt-get install build-essential -y
sudo apt-get install python libssl-dev -y
These commands actually hit a external url which will be impossible since there is no internet connection.I am stuck here.Any help will be much helpful.
$tar -zxf node-v0.10.5.tar.gz
$cd node-v0.10.5
$./configure && make && sudo make install
just download node first from http://nodejs.org/download/
each npm package can stand alone, so by using npm on a machine that has a connection, you can then move the node_modules file with your modules to the new machine.