我用nodejs的npm安装web-ext时总是失败,请帮忙看一下是怎么回事。谢谢!!
    安装命令:npm install --global web-ext
    提示如下:
    npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
    npm WARN deprecated [email protected]: See https://github.com/textlint/textlint/issues/455
    npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
    npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
    /home/ssew/node-v8.11.2-linux-x64/bin/web-ext -> /home/ssew/node-v8.11.2-linux-x64/lib/node_modules/web-ext/bin/web-ext
    npm WARN [email protected] requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/web-ext/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})        [email protected] updated 1 package in 96.971s    系统是debian9.1 (stretch),nodejs是8.11.2LTS版。
    nodejs我是下载到home目录后把node和npm软连接到/usr/local/bin的。
    web-ext我是用于做Firefox扩展用的。

解决方案 »

  1.   

    你好,请先更新你的库,在安装相应依赖,最后安装web-ext
      

  2.   

    今天自己解决了,过程如下:1、在nodejs官网下载源码包node-v8.11.3.tar.gz解压到home目录,解压后的目录名node-v8.11.3。
    2、编译安装:
    cd node-v8.11.3
    ./configure
    make
    sudo make install
    make的时间不短,估计有2个小时。make install前面一定要加sudo,要不会失败。
    3、以上安装完后检测一下:
    命令:node -v
    输出:v8.11.3
    命令:npm -v
    输出:6.1.0
    4、安装web-ext:
    sudo npm i -g npm
    sudo npm install --global web-ext
    其实上面的2条命令是根据下面的过程总结的。过程是这样的:首先npm install --global web-ext,里面有个提示说npm i -g npm,但是运行这个命令后提示权限问题,所以即sudo npm i -g npm,然后再web-ext --version,发现还是没有装上,然后就sudo npm install --global web-ext,这次输出是这样的:
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/web-ext/node_modules/dtrace-provider/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/web-ext/node_modules/dtrace-provider/.node-gyp/8.11.3"
    然后我就直接C-c终止了,但是终止后却发现已经装上了。
    命令:web-ext --version
    输出:2.7.0