简体   繁体   English

尝试安装浏览器同步 ubuntu 时出错

[英]Getting Error when trying to install browser-sync ubuntu

  1. Node is Updated to latest stable version v7.4.0 Node 更新至最新稳定版 v7.4.0

    This is the error message I get when trying to install browser-sync:这是我在尝试安装浏览器同步时收到的错误消息:

     sudo npm install -g browser-sync

'npm ERR! 'npm 错误! Linux 4.4.0-59-generic npm ERR! Linux 4.4.0-59-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "browser-sync" npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "browser-sync" npm ERR! node v7.4.0 npm ERR! node v7.4.0 npm ERR! npm v4.0.5 npm ERR! npm v4.0.5 npm ERR! code MODULE_NOT_FOUND代码 MODULE_NOT_FOUND

npm ERR! npm 错误! Cannot find module 'internal/fs' npm ERR!找不到模块 'internal/fs' npm ERR! npm ERR! npm 错误! If you need help, you may report this error at: npm ERR!如果您需要帮助,您可以在以下位置报告此错误:npm ERR!
https://github.com/npm/npm/issues https://github.com/npm/npm/issues

npm ERR! npm 错误! Please include the following file with any support request: npm ERR!请在任何支持请求中包含以下文件:npm ERR! /home/pedro/npm-debug.log ' /home/pedro/npm-debug.log '

This problem occurs when you are installing a old module(as written in your package.json) but it is not available on git due to update in their version.当您安装旧模块(如 package.json 中所写)但由于版本更新而在 git 上不可用时,会出现此问题。

for solving this issue.为了解决这个问题。

    1.Need to install the project’s local dependencies (that’s where it’s looking for browser-sync). To do that,
    2.cd into the project directory and run npm install.
    3.You can also try npm i browser-sync --save

您还需要升级npm (当前是npm@nextnpm -g install npm@next如果您全局安装了它。

I have Solved the issue:我已经解决了这个问题:

NPM Module was not supported by node v7:节点 v7 不支持 NPM 模块:

So I downgraded to node v6.4.0 and it allowed me install browser-sync with no problems!所以我降级到 node v6.4.0,它让我可以毫无问题地安装浏览器同步!

    sudo npm cache clean -f
    sudo npm install -g n
    sudo n 6.9.5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM