browserify错误/ usr / bin / env:node:没有这样的文件或目录 [英] browserify error /usr/bin/env: node: No such file or directory

查看:156
本文介绍了browserify错误/ usr / bin / env:node:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过apt-get install和所有依赖项安装了节点js和npm,然后我安装了browserify

  npm install browserify -g 

它经历了整个过程,似乎安装正确,但是当我尝试按照使用版本管理器。其中一个是你不必担心这个问题。






说明:




  sudo apt-get update 
sudo apt-get install build-essential libssl-dev

安装必备软件包后,可以从项目的GitHub页面下载nvm安装脚本。版本号可能不同,但一般情况下,您可以使用以下语法下载并安装它:

  curl https:/ /raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh 

这将下载脚本并运行它。它会将软件安装到主目录的子目录中〜/ .nvm 。它还会在〜/ .profile 文件中添加必要的行以使用该文件。



获取访问权限对于nvm功能,您需要注销并重新登录,或者您可以获取〜/ .profile文件,以便您当前的会话知道更改:

  source~ / .profile 

现在你有了安装了nvm,你可以安装隔离的Node.js版本。



要查找可用于安装的Node.js版本,你可以输入:

  nvm ls-remote 
。 。 。

v0.11.10
v0.11.11
v0.11.12
v0.11.13
v0.11.14

正如您所看到的,撰写本文时的最新版本是v0.11.14。您可以通过输入以下命令安装:

  nvm install 0.11.14 

通常,nvm将切换到使用最近安装的版本。您可以通过输入以下内容明确告诉nvm使用我们刚下载的版本:

  nvm使用0.11.14 

使用nvm安装Node.js时,可执行文件称为node。您可以通过输入以下内容来查看shell当前正在使用的版本:

  node -v 

可以找到Comeplete教程这里


I installed node js and npm via apt-get install and all of the dependencies, then I installed browserify

npm install browserify -g

it goes through the process and it seems like it installed correctly, but when I try to do a simple bundle per this walkthrough

I get the error:

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

解决方案

You can also install Nodejs using NVM or Nodejs Version Manager. There are a lot of benefits to using a version manager. One of them being you don't have to worry about this issue.


Instructions:


sudo apt-get update
sudo apt-get install build-essential libssl-dev

Once the prerequisite packages are installed, you can pull down the nvm installation script from the project's GitHub page. The version number may be different, but in general, you can download and install it with the following syntax:

curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh

This will download the script and run it. It will install the software into a subdirectory of your home directory at ~/.nvm. It will also add the necessary lines to your ~/.profile file to use the file.

To gain access to the nvm functionality, you'll need to log out and log back in again, or you can source the ~/.profile file so that your current session knows about the changes:

source ~/.profile

Now that you have nvm installed, you can install isolated Node.js versions.

To find out the versions of Node.js that are available for installation, you can type:

nvm ls-remote
. . .

v0.11.10
v0.11.11
v0.11.12
v0.11.13
v0.11.14

As you can see, the newest version at the time of this writing is v0.11.14. You can install that by typing:

nvm install 0.11.14

Usually, nvm will switch to use the most recently installed version. You can explicitly tell nvm to use the version we just downloaded by typing:

nvm use 0.11.14

When you install Node.js using nvm, the executable is called node. You can see the version currently being used by the shell by typing:

node -v

The comeplete tutorial can be found here

这篇关于browserify错误/ usr / bin / env:node:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆