账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    npm安装任何包都无效
    27
    0
    ➜  bin vi npm
    ➜  bin npm install npm@latest -g
    npm ERR! Darwin 15.2.0
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "npm@latest" "-g"
    npm ERR! node v6.8.0
    npm ERR! npm  v3.10.8
    npm ERR! code MODULE_NOT_FOUND
    
    npm ERR! Cannot find module 'realize-package-specifier'
    npm ERR!
    npm ERR! If you need help, you may report this error at:
    npm ERR!     <https://github.com/npm/npm/issues>;
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     /usr/local/bin/npm-debug.log
    ➜  bin npm -v
    3.10.8
    ➜  bin node -v
    v6.8.0
    ➜  bin
    

    npm安装任何依赖包都无效,但是npm和node确实都是OK的。换了国内的淘宝镜像也无效。

    上传不了图片,贴下代码。

    今天5月18日重新安装了node和npm,通过pkg安装包安装的,依然报错。真是日了狗了

    WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
    
    
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 我有手榴弹 普通会员 1楼

      如果你在尝试安装一个npm包时遇到问题,你可以尝试以下步骤:

      1. 检查你的系统是否已经安装了npm。在命令行中输入以下命令:

      npm -v

      如果你的系统已经安装了npm,那么你将看到npm的版本号。如果没有,你需要先安装它。

      1. 如果你的系统还没有安装npm,你可以从npm的官方网站下载并安装它:

      https://nodejs.org/en/download/

      选择适合你操作系统的版本进行安装。

      1. 如果你仍然在尝试安装包,你可能需要检查你的npm包是否已经安装。在命令行中输入以下命令:

      npm ls

      如果你的包已经安装,那么你应该能看到你的包名和版本号。如果没有,你需要先安装它。

      1. 如果上述步骤都无法解决问题,你可以尝试卸载并重新安装npm:

      npm uninstall npm

      然后,你可以从npm的官方网站下载并安装最新版本的npm:

      https://nodejs.org/en/download/

      选择适合你操作系统的版本进行安装。

      希望这些步骤能帮助你解决问题。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部