env:node:没有这样的文件或目录

lmyy7pcs  于 11个月前  发布在  Node.js
关注(0)|答案(7)|浏览(110)

env:node:没有这样的文件或目录
我检查了我的节点目录是否正确,它很好。
我已经尝试了以下答案: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$

字符串

krugob8w

krugob8w1#

  • 试试node -v看看你是否安装了node。我认为你的node不能工作。
  • nvm是node的环境管理。如果你使用nvm,你应该使用brew install nvm,使用nvm install version-of-node-you-want-to-install安装node,使用nvm use the-version让node工作。
  • 整个安装链是:
  • brew install nvm,安装nvm,这是节点的环境/版本管理。
  • nvm install 10.3.0,安装nodenpm
  • npm install -g yarn,安装yarn
  • 使用node -vnpm -vnvm -vyarn -v来检查它们是否都工作。
lqfhib0f

lqfhib0f2#

执行以下步骤:
1.哪个节点

  1. sudo ln -s /home/ubuntu/.nvm/versions/node/v12.13.1/bin/node(以上步骤的输出)/usr/bin/node
rwqw0loc

rwqw0loc3#

对我来说,我意识到,钩不工作时,通过发射器开放。
相反,我通过运行以下命令通过终端打开SourceTree:
第一个月

oprakyz7

oprakyz74#

我在Ubuntu上尝试更新我的npm版本时遇到了同样的问题:

sudo npm install -g npm

字符串
我已经解决了不使用sudo的问题:

npm install -g npm

ni65a41a

ni65a41a5#

如果你之前已经安装了nvm或者node,并且它工作正常,我建议你尝试刷新你的bash启动文件。
有时会有多个bash启动文件,你可以检查哪个包含nvm环境导出设置来定位它。

hc8w905p

hc8w905p6#

对一些人来说,这可能就像忘记跑步一样简单
npm使用节点
或者说是在我的案子里

ny6fqffe

ny6fqffe7#

我正在使用节点版本管理器(nvm)(不使用brew
如果您在启动新的HTTP或BASH会话时看到此情况,那么您可能需要检查~/.zshrc~/.bashrc)文件。nvm在文件末尾添加了一些环境代码。这应该会在您的终端中配置默认节点版本。
但是也许你的.zshrc文件中已经有一些依赖于node的代码了?所以把nvm init代码移到其他需要“节点”的代码上面。

相关问题