在 Ubuntu 16.04 上从源代码构建 Nylas N1

在 Ubuntu 16.04 上从源代码构建 Nylas N1

Ubuntu 似乎没有 N1 从源代码编译时所寻找的内容。这是我运行初始脚本时得到的输出:

N1-master$ script/grunt
/usr/bin/env: ‘node’: No such file or directory

有人成功从 master 编译过吗?他们可以提供指南吗?

编辑:即使按照 edwinksl 链接的指南运行 scripts/bootstrap 命令也会出现以下错误:

$ script/bootstrap 
Node: v4.2.6
npm: v3.5.2

---> Installing N1 build tools
     This goes inside the `build` folder and runs `npm install`
     It will use the system `npm` to bootstrap our own N1 npm.
     Our build tools (like Grunt) need to be compiled against Node via `npm`.
     Everything else needs to be compiled against Chromium with `apm`.

     $ npm --userconfig="/home/jarlath/Downloads/N1-master/.npmrc" install --loglevel error --cwd="/home/jarlath/Downloads/N1-master/build" --ignoreStdout=true 

npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "--userconfig=/home/jarlath/Downloads/N1-master/.npmrc" "install" "--loglevel" "error"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path /home/jarlath/.npm/registry.npmjs.org/grunt-contrib-less/.cache.json.4179490079
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall lstat

npm ERR! enoent ENOENT: no such file or directory, lstat '/home/jarlath/.npm/registry.npmjs.org/grunt-contrib-less/.cache.json.4179490079'
npm ERR! enoent ENOENT: no such file or directory, lstat '/home/jarlath/.npm/registry.npmjs.org/grunt-contrib-less/.cache.json.4179490079'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/jarlath/Downloads/N1-master/build/npm-debug.log

答案1

假设你已经安装了nodejs(sudo apt-get install nodejs),问题与报告的相同这里— Ubuntu 和 Debian 现在安装在/usr/bin/nodejs而不是/usr/bin/node

从长远来看,最不可能破坏你的系统的两种解决方案是:

  1. 安装 nodejs-legacy(sudo apt-get install nodejs-legacy),它提供从 node 到 nodejs 的符号链接。(来源
  2. 使用 update-alternatives 提供符号链接(来源):

    sudo update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100
    

相关内容