背景

安装了node后,执行npm run xxx的命令的时候,报错,提示如下:

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

步骤

1. 什么玩意,执行一个npm命令怎么提示/usr/bin/env这个错误呢,翻阅资料

资料都提示要创建一个软连接,如下:

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

2. 推测!!因为npm执行的时候默认是使用/usr/bin/node去执行的,但我本地是没有/usr/bin/node的,所以需要创建一个

所以需要创建一个软连接将自己的node的执行文件指到/usr/bin/node上,于是修改如下:

ln -s /usr/local/NODEJS_HOME/bin/node /usr/bin/node

3. 再执行,OK了

【node错误】/usr/bin/env: node: No such file or directory的更多相关文章

  1. #! /usr/bin node 和#! /usr/bin/env node两者的区别

    是Unix和Linux脚本语言的第一行,目的就是指出,你想要你的这个文件中的代码用什么可执行程序去运行它 !/usr/bin/node是告诉操作系统执行这个脚本的时候,调用/usr/bin下的node ...

  2. /usr/bin/env python no such file or directory: dos格式导致的!

    最近修改了几个python文件,发现在linux上只能用python file来执行,直接./file提示错误"no such file or directory",而脚本是用&q ...

  3. 调用python脚本报错/usr/bin/env: python : No such file or directory

    一.调用python脚本报错 /usr/bin/env: python: No such file or directory 二.解决方法 原因是在windows上编写的脚本,使用dos2unix对脚 ...

  4. /usr/bin/env: php: No such file or directory 【xunsearch demo项目体验】【已解决】

    出现这个问题的原因是/usr/local/bin 或 /usr/bin 下面没有php可执行文件 解决办法: 建立一条硬链接 ln /path/to/bin/php  /usr/local/bin/p ...

  5. [xampp] /usr/bin/env: php: No such file or directory

    ln -s /opt/lampp/bin/php /usr/local/bin/php

  6. Cannot install NodeJs: /usr/bin/env: node: No such file or directory

    安装doxmate时,doxmate地址是:https://github.com/JacksonTian/doxmatenpm install doxmate -g 安装完后把错误:Cannot in ...

  7. 配置webstorm使用supervisor时出现 /usr/bin/env: node: 没有那个文件或目录 解决方法

    配置好supervisor路径后 出现了 启动时出现了 /usr/bin/env: node: 没有那个文件或目录 需要讲.nvm下的node链接到, /usr/bin/目录下 sudo ln -s ...

  8. /usr/bin/env: node: no such file or directory

    今天在安装gulp的之后,运行gulp命令出现了如下报错: /usr/bin/env: node: no such file or directory 网上找了好久,终于解决了,所以记录一下,便于下次 ...

  9. 运行hexo提示/usr/bin/env: node: 没有那个文件或目录

    由于Ubuntu下已经有一个名叫node的库,因此Node.js在ubuntu下默认叫nodejs,需要额外处理一下. 这个时候需要人为的建立链接,很简单一句话即可! sudo ln -s `whic ...

随机推荐

  1. Hive-表连接

    Hive只支持等值连接,即ON子句中使用等号连接,不支持非等值连接. Hive内置的数据存储类型,TextFile, SequenceFile, ORC(列式存储) 如果连接语句中有WHERE子句,会 ...

  2. CFGym 100198G 题解

    一.题目链接 http://codeforces.com/gym/100198/problem/G 二.题意 看样例就能明白,写表达式解析器. 三 .思路 一看这题目,立马就会想到“后缀表达式”,考虑 ...

  3. 【POJ】1185 炮兵阵地(状压dp)

    题目 传送门:QWQ 分析 看到$ M<=10 $考虑状压. 然后把每行都压一下,那么每个状态相关的就是上一行和上上行的状态. 然后枚举. 然后复杂度最坏是$ O(100 \times 1024 ...

  4. Hyberledger-Fabric 1.00 RPC学习(2)尝试建立一个network

    本文参考:http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html 这里我们学习建立第一个Hyperledger Fa ...

  5. uva-10815-字符串排序

    又偷懒了,字符串排序,贱贱的用了std:map #include <iostream> #include <sstream> #include<algorithm> ...

  6. jquery的html代码中a的onclick的正确显示的代码

    jquery的html代码中a的onclick的正确显示的代码 需要转义一下,试了好久才试出来 img_delete.html('<a onclick="deleteImg(\''+s ...

  7. leetcode738

    public class Solution { public int MonotoneIncreasingDigits(int N) { var num = N.ToString(); var len ...

  8. Vue项目中将table组件导出Excel表格以及打印页面内容

    体验更优排版请移步原文:http://blog.kwin.wang/programming/vue-table-export-excel-and-print.html 页面中显示的table表格,经常 ...

  9. VB.NET条码机打印设置纸张大小的方法

    Imports System.Drawing.PrintingImports System.Runtime.InteropServices Public Class Page    <Runti ...

  10. Vue 实现微信 jssdk 扫码, 上传图片

    流程 1: 配置微信公众号JS域名 2:前端发送URL后台获取JSSDK配置, 后台Service代码如下, 修改2处位置: WeixinUtil.APPID => 当前公众号APPID Wei ...