Linux node no such file or directory

env: node: No such file or directory

env: node: No such file or directory I checked if my directory for node wasn’t wrong and it’s fine. I tried these following answers already: 1. https://github.com/nodejs/node-v0.x-archive/issues/3911 2. https://github.com/creationix/nvm/issues/1702 3. browserify error /usr/bin/env: node: No such file or directory

USER-no-MacBook-Pro-2:nomadcoin user$ yarn init env: node: No such file or directory USER-no-MacBook-Pro-2:nomadcoin user$ brew install node Updating Homebrew. ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae acpica fantom lego qmmp bat fn libdca rubberband bazel fselect libpqxx ruby-build cake fstar nativefier saxon calabash groovysdk openimageio shellcheck cdrdao h2o pegtl sqlmap cmake hadoop percona-server teleport conan heroku phpunit urh convox jenkins-job-builder pike etcd jetty ponyc exomizer jetty-runner pygobject3 Warning: node 10.3.0 is already installed, it's just not linked You can use `brew link node` to link this version. USER-no-MacBook-Pro-2:nomadcoin user$ brew link node Linking /usr/local/Cellar/node/10.3.0. Error: Could not symlink include/node/android-ifaddrs.h Target /usr/local/include/node/android-ifaddrs.h already exists. You may want to remove it: rm '/usr/local/include/node/android-ifaddrs.h' To force the link and overwrite all conflicting files: brew link --overwrite node To list all files that would be deleted: brew link --overwrite --dry-run node USER-no-MacBook-Pro-2:nomadcoin user$ brew link --overwrite --dry-run node Would remove: /usr/local/include/node/android-ifaddrs.h /usr/local/include/node/common.gypi /usr/local/include/node/config.gypi /usr/local/include/node/libplatform/libplatform-export.h /usr/local/include/node/libplatform/libplatform.h /usr/local/include/node/libplatform/v8-tracing.h /usr/local/include/node/node.h /usr/local/include/node/node_api.h /usr/local/include/node/node_api_types.h /usr/local/include/node/node_buffer.h /usr/local/include/node/node_object_wrap.h /usr/local/include/node/node_version.h /usr/local/include/node/openssl/aes.h /usr/local/include/node/openssl/asn1.h /usr/local/include/node/openssl/asn1_mac.h /usr/local/include/node/openssl/asn1t.h /usr/local/include/node/openssl/bio.h /usr/local/include/node/openssl/blowfish.h /usr/local/include/node/openssl/bn.h /usr/local/include/node/openssl/buffer.h /usr/local/include/node/openssl/camellia.h /usr/local/include/node/openssl/cast.h /usr/local/include/node/openssl/cmac.h /usr/local/include/node/openssl/cms.h /usr/local/include/node/openssl/comp.h /usr/local/include/node/openssl/conf.h /usr/local/include/node/openssl/conf_api.h /usr/local/include/node/openssl/crypto.h /usr/local/include/node/openssl/des.h /usr/local/include/node/openssl/dh.h /usr/local/include/node/openssl/dsa.h /usr/local/include/node/openssl/dtls1.h /usr/local/include/node/openssl/e_os2.h /usr/local/include/node/openssl/ebcdic.h /usr/local/include/node/openssl/ec.h /usr/local/include/node/openssl/ecdh.h /usr/local/include/node/openssl/ecdsa.h /usr/local/include/node/openssl/engine.h /usr/local/include/node/openssl/err.h /usr/local/include/node/openssl/evp.h /usr/local/include/node/openssl/hmac.h /usr/local/include/node/openssl/idea.h /usr/local/include/node/openssl/lhash.h /usr/local/include/node/openssl/md4.h /usr/local/include/node/openssl/md5.h /usr/local/include/node/openssl/mdc2.h /usr/local/include/node/openssl/modes.h /usr/local/include/node/openssl/obj_mac.h /usr/local/include/node/openssl/objects.h /usr/local/include/node/openssl/ocsp.h /usr/local/include/node/openssl/opensslconf.h /usr/local/include/node/openssl/opensslv.h /usr/local/include/node/openssl/ossl_typ.h /usr/local/include/node/openssl/pem.h /usr/local/include/node/openssl/pem2.h /usr/local/include/node/openssl/pkcs12.h /usr/local/include/node/openssl/pkcs7.h /usr/local/include/node/openssl/rand.h /usr/local/include/node/openssl/rc2.h /usr/local/include/node/openssl/rc4.h /usr/local/include/node/openssl/ripemd.h /usr/local/include/node/openssl/rsa.h /usr/local/include/node/openssl/safestack.h /usr/local/include/node/openssl/seed.h /usr/local/include/node/openssl/sha.h /usr/local/include/node/openssl/srp.h /usr/local/include/node/openssl/srtp.h /usr/local/include/node/openssl/ssl.h /usr/local/include/node/openssl/ssl2.h /usr/local/include/node/openssl/ssl3.h /usr/local/include/node/openssl/stack.h /usr/local/include/node/openssl/symhacks.h /usr/local/include/node/openssl/tls1.h /usr/local/include/node/openssl/ts.h /usr/local/include/node/openssl/txt_db.h /usr/local/include/node/openssl/ui.h /usr/local/include/node/openssl/whrlpool.h /usr/local/include/node/openssl/x509.h /usr/local/include/node/openssl/x509_vfy.h /usr/local/include/node/openssl/x509v3.h /usr/local/include/node/pthread-barrier.h /usr/local/include/node/stdint-msvc2008.h /usr/local/include/node/tree.h /usr/local/include/node/uv-aix.h /usr/local/include/node/uv-bsd.h /usr/local/include/node/uv-darwin.h /usr/local/include/node/uv-errno.h /usr/local/include/node/uv-linux.h /usr/local/include/node/uv-os390.h /usr/local/include/node/uv-posix.h /usr/local/include/node/uv-sunos.h /usr/local/include/node/uv-threadpool.h /usr/local/include/node/uv-unix.h /usr/local/include/node/uv-version.h /usr/local/include/node/uv-win.h /usr/local/include/node/uv.h /usr/local/include/node/v8-inspector-protocol.h /usr/local/include/node/v8-inspector.h /usr/local/include/node/v8-platform.h /usr/local/include/node/v8-profiler.h /usr/local/include/node/v8-testing.h /usr/local/include/node/v8-util.h /usr/local/include/node/v8-value-serializer-version.h /usr/local/include/node/v8-version-string.h /usr/local/include/node/v8-version.h /usr/local/include/node/v8.h /usr/local/include/node/v8config.h /usr/local/include/node/zconf.h /usr/local/include/node/zlib.h /usr/local/share/doc/node/gdbinit /usr/local/share/doc/node/lldb_commands.py /usr/local/share/doc/node/lldbinit /usr/local/share/man/man1/node.1 /usr/local/share/systemtap/tapset/node.stp /usr/local/lib/dtrace/node.d USER-no-MacBook-Pro-2:nomadcoin user$ brew link node Linking /usr/local/Cellar/node/10.3.0. Error: Could not symlink include/node/android-ifaddrs.h Target /usr/local/include/node/android-ifaddrs.h already exists. You may want to remove it: rm '/usr/local/include/node/android-ifaddrs.h' To force the link and overwrite all conflicting files: brew link --overwrite node To list all files that would be deleted: brew link --overwrite --dry-run node USER-no-MacBook-Pro-2:nomadcoin user$ run node bash: run: command not found USER-no-MacBook-Pro-2:nomadcoin user$ brew install node --force Warning: node 10.3.0 is already installed, it's just not linked You can use `brew link node` to link this version. USER-no-MacBook-Pro-2:nomadcoin user$ brew install node --rf Warning: node 10.3.0 is already installed, it's just not linked You can use `brew link node` to link this version. USER-no-MacBook-Pro-2:nomadcoin user$ brew install -rf node Warning: node 10.3.0 is already installed, it's just not linked You can use `brew link node` to link this version. USER-no-MacBook-Pro-2:nomadcoin user$ node install yarn bash: node: command not found USER-no-MacBook-Pro-2:nomadcoin user$ npm install yarn env: node: No such file or directory USER-no-MacBook-Pro-2:nomadcoin user$ brew install yarn -g Warning: yarn 1.7.0 is already installed and up-to-date To reinstall 1.7.0, run `brew reinstall yarn` USER-no-MacBook-Pro-2:nomadcoin user$ brew reinstall yarn ==> Reinstalling yarn ==> Downloading https://yarnpkg.com/downloads/1.7.0/yarn-v1.7.0.tar.gz Already downloaded: /Users/user/Library/Caches/Homebrew/yarn-1.7.0.tar.gz 🍺 /usr/local/Cellar/yarn/1.7.0: 14 files, 4.2MB, built in 1 second USER-no-MacBook-Pro-2:nomadcoin user$ yarn install env: node: No such file or directory USER-no-MacBook-Pro-2:nomadcoin user$ yarn init env: node: No such file or directory USER-no-MacBook-Pro-2:nomadcoin user$ ln -s /usr/bin/nodejs /usr/bin/node ln: /usr/bin/node: Operation not permitted USER-no-MacBook-Pro-2:nomadcoin user$ sudo ln -s /usr/bin/nodejs /usr/bin/node Password: ln: /usr/bin/node: Operation not permitted USER-no-MacBook-Pro-2:nomadcoin user$ $ sudo apt-get install nodejs-legacy bash: $: command not found USER-no-MacBook-Pro-2:nomadcoin user$ $ sudo brew install nodejs-legacy bash: $: command not found USER-no-MacBook-Pro-2:nomadcoin user$ npm debug env: node: No such file or directory USER-no-MacBook-Pro-2:nomadcoin user$ nvm debug bash: nvm: command not found USER-no-MacBook-Pro-2:nomadcoin user$ sudo chown -R $USER /usr/local chown: /usr/local: Operation not permitted USER-no-MacBook-Pro-2:nomadcoin user$ npm --version env: node: No such file or directory USER-no-MacBook-Pro-2:nomadcoin user$ nvm --version bash: nvm: command not found USER-no-MacBook-Pro-2:nomadcoin user$ nvm install bash: nvm: command not found USER-no-MacBook-Pro-2:nomadcoin user$ ln -s /usr/local/Cellar/node /usr/bin/node ln: /usr/bin/node: Operation not permitted USER-no-MacBook-Pro-2:nomadcoin user$ 

Источник

Читайте также:  Run linux kernel on windows

Node forever /usr/bin/env: node: No such file or directory

Now i go to my project /var/www/myproject and attempt to run forever start server.js then i get the following message:

/usr/bin/env: node: No such file or directory 

3 Answers 3

EDIT: As of December 2018, this is no longer the correct way. See the other two answers.

You need to symlink the nodejs executable to node sudo ln -s «$(which nodejs)» /usr/local/bin/node The reason for this is that when you do «apt-get install node», it installs an unrelated package, so they had to choose a different name so it wouldn’t conflict

«$(which nodejs)» gets the path of the nodejs executable. When you put something inside of «$()» it gets executed and then inserted into the containing command

@chedabob I have faced the same problem but I had not yet resolved it when I am running your command at that time I got the ln: failed to create symbolic link ‘/usr/bin/node’: File exists

@dasadiya-chaitanya In that case make sure that the existing file is pointing to a correct node executable by running the following. ls -lart /usr/bin/node. If the symlink is not pointing to the correct binary, in that case delete it. And re-run the following: sudo ln -s «$(which nodejs)» /usr/bin/node

On Debian and Ubuntu, there is a package nodejs-legacy providing the symbolic link. You’re not supposed to do it manually. apt-get install nodejs-legacy is the correct way to fix the problem, see my answer below.

While the accepted answer fixes the problem, the correct way to do that, at least with Debian Jessie and forward and Ubuntu 14.4 and forward1 is to install nodejs-legacy:

apt-get install nodejs-legacy 

The reason is that Debian already had a package (node) providing /usr/bin/node, and the nodejs node binary had to be installed into /usr/bin/nodejs.

Читайте также:  Astra linux предупреждение debootstrap

The nodejs-legacy package provides a symbolic link from /usr/bin/nodejs to /usr/bin/node (and conflicts with the node package).

Источник

«/usr/bin/env: ‘node’: No such file or directory» even though it is in PATH

I’m trying to get nodejs working. However, it tells me that node is not in my bin even though I downloaded the binary and added the location to my path. > echo $PATH . /home/jvdh/node-v8.11.2-linux-x64/bin >sudo npm install -g bitcore
/usr/bin/env: ‘node’: No such file or directory

that works better but then I get this: npm ERR! Please try running this command again as root/Administrator.

3 Answers 3

Usually this is a simple naming problem, when you install from a package manager your bin file may be called nodejs so you just need to symlink it using the command:

ln -s /usr/bin/nodejs /usr/bin/node

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs 
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs 

For Ubuntu 20.04, you can install node.js and npm:

sudo apt install nodejs npm 

You must log in to answer this question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.12.43529

Ubuntu and the circle of friends logo are trade marks of Canonical Limited and are used under licence.

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Читайте также:  Fdisk linux создаем разделы

Источник

Оцените статью
Adblock
detector