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

后端 未结 9 616
盖世英雄少女心
盖世英雄少女心 2020-11-29 17:17

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

9条回答
  •  醉话见心
    2020-11-29 18:05

    You have to call "nodejs" and not "node". To verify this, type node -v on the shell: if nothing is found try nodejs -v. If that displays a version number, then the command you should be using is nodejs and not node. Therefore, you have to change the call to browserify in your script from node to nodejs (as shown below): replace

    #!/usr/bin/env node
    

    with

    #!/usr/bin/env nodejs
    

    You might also have to open the script as the superuser.

提交回复
热议问题