nodejs conflicts with node (re installing nodejs) - javascript

I am trying to reinstall node. I was screwing around a little bit trying to download a newer version.
So to uninstall I cleared out the node and node_module parts inside usr/local/bin/ and usr/local/src
Following these instructions
https://github.com/joysent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint
When I run
xx.x#x:~/src/node-v0.10.18$ checkinstall
I get
dpkg: regarding .../node_0.10.18-1_i386.deb containing node:
nodejs conflicts with node
node (version 0.10.18-1) is to be installed.
node provides node and is to be installed.
dpkg: error processing /home/hassan/src/node-v0.10.18/node_0.10.18-1_i386.deb (--install):
conflicting packages - not installing node
Errors were encountered while processing:
/home/hassan/src/node-v0.10.18/node_0.10.18-1_i386.deb
(END)
I am not sure what else I should be doing. I tried a few other things.
:(
More details
This is what shows up on the command line
Copying files to the temporary directory...OK
Stripping ELF binaries and libraries...OK
Compressing man pages...OK
Building file list...OK
Building Debian package...OK
Installing Debian package... FAILED!
*** Failed to install the package
Do you want to see the log file? [y]: y
*** SIGINT received ***
Restoring overwritten files from backup...OK
Cleaning up...OK
Bye.
OH I solved it! I deleted all of the node related files through synaptic !! :D!

You may be able to use my pre-built packages which are available here:
https://launchpad.net/~chris-lea/+archive/node.js
They install a /usr/bin/nodejs binary and then create a symlink from that to /usr/bin/node.
If you are going to use these, be sure to remove any vestiges of any previous installs so that the system is using the correct binaries.

Related

Got an error trying to install mod_v8 for FreeSwitch 10 in Debian 11: You need to either install libv8-6.1-dev, ibv8fs-dev

On a "clean" Debian 11, I deployed all the necessary packages and began to build FreeSWITCH 10 with the mod_v8 module enabled.
When executing the ./configure command, I get the message:
checking for v8-6.1_static >= 6.1.298...
checking for v8fs_static >= 6.1.298...
checking for v8 >= 6.1.298...
configure: error: You need to either install **libv8-6.1-dev** (>= 6.1.298), **libv8fs-dev** (>= 6.1.298) or disable mod_v8 in modules.conf
There are no packages named libv8-6.1-dev and libv8fs-devlibv8fs-dev in Debian 11.
I was looking for packages in Debian 11 that contain v8, with the command search v8 and installed all the packages found that mention v8 and JavaScript:
libv8-dev libnode-dev libnode72 node-babel7-standalone node-clean-css node-get-caller-file node-nan node-to-fast-properties node-v8flags nodejs
I also installed libv8 packages which are mentioned here: https://lists.freeswitch.org/pipermail/freeswitch-users/2021-July/134874.html
But I still get the error message.
What packages do I need to install? Is there a command that will help me find the names of the necessary packages that contain: libv8-6.1-dev (>= 6.1.298), libv8fs-dev (>= 6.1.298)?
The procedure for installing mod_v8 on Debian 11.
Download and install deb packages from here (registration required):
https://freeswitch.signalwire.com/repo/deb/freeswitch-1.8/pool/main/libv/
Install the downloaded packages with the command:
sudo apt install -y ./package_name.deb
List of packages (some may not install):
libv8-6.1_6.1.298-1_bullseye_amd64.deb
libv8-6.1_6.1.298-1_buster_amd64.deb
libv8-6.1_6.1.298-1_stretch_amd64.deb
libv8-6.1-dbg_6.1.298-1_bullseye_amd64.deb
libv8-6.1-dbg_6.1.298-1_buster_amd64.deb
libv8-6.1-dbg_6.1.298-1_stretch_amd64.deb
libv8-6.1-dev_6.1.298-1_bullseye_amd64.deb
libv8-6.1-dev_6.1.298-1_buster_amd64.deb
libv8-6.1-dev_6.1.298-1_stretch_amd64.deb
libv8fs-6.1_6.1.298-1_stretch_amd64.deb
libv8fs-6.1-dbg_6.1.298-1_stretch_amd64.deb
libv8fs-6.1-dev_6.1.298-1_stretch_amd64.deb
If FreeSWITCH is already installed, then you need to uncomment along the path:
/usr/local/freeswitch/conf/autoload_configs
in the file:
modules.conf.xml
line:
load module="mod_v8"
Then install only mod_v8 via (run from the FreeSWITCH build folder): make mod_v8-install
If FREESWITCH not installed, then enable mod_v8 in the modules.conf file in the freeswitch (or freeswitch-master) folder from which the build will be made.
Finally, in the FreeSWITCH console, run the load mod_v8 command (the answer must be True).
Did you try install from the website?
https://packages.debian.org/stretch/libv8-dev
There is a download link
The mailing list conversation you linked also contains this snippet:
You should try building libv8 packages from here: https://github.com/freeswitch/libv8-packaging
I'd try that.
It doesn't look like Debian has ever had an official libv8-6.1-dev package, or at least I can't find any traces of it. It definitely doesn't offer one now.
(The whole thing does seem a bit sketchy; that build script uses V8 6.1.298, which is a random daily snapshot from mid-2017; but hey, as long as it never touches possibly-attacker-controlled scripts or input data, I guess it's fine... who needs production-quality releases in their production setups, eh?
You could try to at least switch to the tip of the stabilized 6.1 branch, which would be the 6.1.534.44 tag (a.k.a. branch-heads/6.1), but (1) that also hasn't received any further fixes for five years now, and (2) if you're already having trouble getting things to work, then any deviation from workflows that are said to have worked before only increases the risk of further trouble.)

Can't get Grunt to run

I'm a little confused as to why I can't get my Gruntfile.js to run, here's the rub:
I installed grunt globally using npm. It lives in my /usr/local/bin/ directory, here it is:
Previously, I'd installed node.js using homebrew, then grunt with npm. Other issues led me to uninstall node via homebrew & reinstall node directly from the disk image node provides.
In my web project's index, there's a Gruntfile.js script that rebuilds my jekyll site everytime live-reload updates. When I run grunt, I get this message:
What I'm trying to wrap my head around:
Why isn't /usr/local/bin/grunt a valid path? Grunt exists at that location. My guess was that running grunt locally, from within my website's index, would fix things.
There's a node_modules folder there & everything was working fine before after all. I found this link, and tried running \grunt to bypass the bash alias, but that had no effect.
Any advice/suggestions are much appreciated! I feel like an imbecile using things, breaking things & not understanding why/how. Eager to finish my project, get a paycheck & finally have time to learn the ins and outs of terminal, bash & popular package managers so I don't run into these sorts of problems...
After discussion with OP, I find this is a Node.js environment issue. After install - do something - uninstall - reinstall in another way - do something, somehow, when npm install -g XXX is executed, the symbolic link is created and point to some place, but the package is installed some where else. That's why OP see /usr/local/bin/grunt but cannot run it.
I've recommended OP to clean up all Node.js stuff, make a clean environment and start right from the beginning.

Node installed but node cannot be found in Ubuntu VPS

I installed node via NVM. I installed node 0.10.32. using NVM 0.25.0
When I do node -v I get
-bash: /root/.nvm/v0.10.32/bin/node: No such file or directory
when I do npm v I get
/root/.nvm/v0.10.32/bin/npm: 2: exec: /root/.nvm/v0.10.32/bin/node: not found
All those directories exist and node executable is in it but they are reading as not found. Node seems to be installed but I am unable to use it. I am not sure how to fix this issue. Any ideas will be greatly appreciated
Check that your ~/.bash_profile has this:
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
https://github.com/creationix/nvm/issues/576
A lot of things can be wrong here from what you describe. Generally I don't recommend using nvm to install Node on servers. It works fine for your own work on a local machine but when you need to be sure what is installed and where, I recommend doing a real installation.
I recently wrote a tutorial on how to install Node on Linux:
https://gist.github.com/rsp/edf756a05b10f25ee305cc98a161876a
It is specifically about version 6.7.0 but just change the version number to use any other version of Node.
You can see other answers showing how to install Node properly and troubleshoot if it isn't installed correctly:
Run npm as superuser, it isn't a good idea?
node 5.5.0 already installed but node -v fetches with "v4.2.1" on OS X & homebrew?
Just get the binary or source package of the version that you need, install it where you want and it will work. The most reliable way is to install a source package because you can run make test before you install and because npm will have the correct shebang line (which may not always be the case with binary distribution - which, incidentally, is also used by nvm). No need to use nvm or any other tool to do that.
The nvm is great if you need to quickly switch Node versions during development on your local machine but if you want a reliable way to install Node on the server then it's best to install it normally.

Error: Cannot find module 'entities/lib/decode_codepoint.js'

I am using cheerio module for web scraping . It require htmlparser2 module , after installing htmlparser2. it gives following error-
Error: Cannot find module 'entities/lib/decode_codepoint.js'
Use this in your terminal:
npm install grunt-contrib-jshint --save-dev
Seen here:
https://www.npmjs.com/package/grunt-contrib-jshint
Below is applicable to Windows environment only, not Linux.
I received the same error when I tried to build jquery from source on Windows. It turns out that jsdom and/or grunt-contrib-jshint (both of which depend on htmlparser2) require gyp and for gyp to work you need a c++ compiler and python. I thought that I had them but turned out, that python need to be version 2.x not version 3.x. If it is 3.x it gives you a proper error on the first run (that I missed) and on subsequent runs you are getting the error in the question above which makes you wonder what's going on.
So I uninstalled python 3.x, installed python 2.x (don't forget make sure that python.exe is in your path), then deleted the node_modules folder in the project root and ran the build again.
This time around it worked. I'm not sure if this solves the OP question, but I hope it helps someone.

NodeJs - FTP not working: "npm-shrinkwrap.json is not provided"

I have got a Nodejs app on AppFog and want to connect to a ftp-server with this.
I did install it with npm install ftp using "Ruby Command Prompt"
This is the only code line:
var FTPClient = require('ftp');
Trying to start the app, it throws an error:
Skipping npm-support: npm-shrinkwrap.json is not provided
Which kind of server should I use or what's the problem?
Still doesn't start:
Starting Application 'test007': .
Error: Application [test007] failed to start, logs information below.
====> /logs/staging.log <====
# Logfile created on 2013-03-09 10:37:09 +0000 by logger.rb/25413
Installing dependencies. Node version 0.8.14
Installing ftp#0.2.9 from local path
Installing xregexp#2.0.0 from local path
Installing node#0.0.0 from local path
Installing nodejs#0.0.1 from local path
But no error is shown.
Thanks in advance
The quick fix is to type npm shrinkwrap, which will provide an npm-shrinkwrap file.
A shrinkwrap file fixes the exact versions of your dependencies, and the exact version of their dependencies, and so on. Without it, each usage of npm install could install different versions of the packages -- sometimes, just different bugfix versions (1.4.2 vs 1.4.3), but sometimes much greater differences. There's no guarantee that your code will work with different dependency versions (in fact it is not uncommon to break), so shrinkwrapping is a great idea for any production-level code.
If you want to 'unshrinkwrap', just delete the npm-shrinkwrap.json. You can re-shrinkwrap at any point.

Categories

Resources