mac终端安装webpack的时候报错Err,解决的办法 sudo npm install webpack -g

时间:2022-10-24 19:19:21

MacBook-Air:~ xxx$ npm install webpack -g

npm WARN invalid config registry=""

npm WARN invalid config Must be a full url with 'http://'

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/acorn-dynamic-import

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/ajv

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/brorand

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/error-ex

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/for-in

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/for-own

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/abbrev

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/ansi-regex

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/aproba

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/aws4

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/bcrypt-pbkdf

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/chalk/node_modules/supports-color

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/jsbn

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/mime-db

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/mime-types

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/object-assign

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/gauge

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/qs

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/sshpk

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/strip-json-comments

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/rc

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/node-pre-gyp

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/supports-color

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/hosted-git-info

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/is-buffer

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/loader-utils

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/elliptic

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/normalize-package-data

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/parse-asn1

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/readable-stream

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/uglify-js/node_modules/async

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/uglify-js

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/watchpack

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/chalk/node_modules

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/webpack/node_modules/uglify-js/node_modules

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

- supports-color@2.0.0 node_modules/webpack/node_modules/fsevents/node_modules/chalk/node_modules/supports-color

- async@0.2.10 node_modules/webpack/node_modules/uglify-js/node_modules/async

/usr/local/lib

└─┬ webpack@2.2.1

├── acorn-dynamic-import@2.0.2

├── ajv@4.11.5

├── loader-utils@0.2.17

├─┬ memory-fs@0.4.1

│ └── readable-stream@2.2.6

├─┬ node-libs-browser@2.0.0

│ └─┬ crypto-browserify@3.11.0

│ └─┬ browserify-sign@4.0.0

│ ├─┬ elliptic@6.4.0

│ │ ├── brorand@1.1.0

│ │ ├── hmac-drbg@1.0.0

│ │ └── minimalistic-crypto-utils@1.0.1

│ └── parse-asn1@5.1.0

├── uglify-js@2.8.14

├─┬ watchpack@1.3.1

│ └─┬ chokidar@1.6.1

│ ├─┬ anymatch@1.3.0

│ │ └─┬ micromatch@2.3.11

│ │ ├─┬ kind-of@3.1.0

npm ERR! Darwin 15.5.0

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webpack" "-g"

npm ERR! node v6.2.0

npm ERR! npm v3.8.9

npm ERR! path /usr/local/lib/node_modules/webpack/node_modules/acorn-dynamic-import

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall access

 

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/webpack/node_modules/acorn-dynamic-import'

npm ERR! at Error (native)

npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/webpack/node_modules/acorn-dynamic-import'

npm ERR! at Error (native)

npm ERR! errno: -13,

npm ERR! code: 'EACCES',

npm ERR! syscall: 'access',

npm ERR! path: '/usr/local/lib/node_modules/webpack/node_modules/acorn-dynamic-import' }

npm ERR!

npm ERR! Please try running this command again as root/Administrator.

40mis-buffer@1.1.5

│ │ └─┬ object.omit@2.0.1

│ │ └─┬ for-own@0.1.5

│ │ └── for-in@1.0.2

│ └─┬ fsevents@1.1.1

│ └─┬ node-pre-gyp@0.6.33

│ ├─┬ nopt@3.0.6

│ │ └── abbrev@1.1.0

│ ├─┬ npmlog@4.0.2

│ │ └─┬ gauge@2.7.3

│ │ ├── aproba@1.1.1

│ │ ├── object-assign@4.1.1

│ │ └─┬ strip-ansi@3.0.1

│ │ └── ansi-regex@2.1.1

│ ├─┬ rc@1.1.7

│ │ └── strip-json-comments@2.0.1

│ └─┬ request@2.79.0

│ ├── aws4@1.6.0

│ ├─┬ har-validator@2.0.6

│ │ └─┬ chalk@1.1.3

│ │ └── supports-color@2.0.0

│ ├─┬ http-signature@1.1.1

│ │ └─┬ sshpk@1.10.2

│ │ ├── bcrypt-pbkdf@1.0.1

│ │ └── jsbn@0.1.1

│ ├─┬ mime-types@2.1.14

│ │ └── mime-db@1.26.0

│ └── qs@6.3.1

├── webpack-sources@0.1.5

└─┬ yargs@6.6.0

└─┬ read-pkg-up@1.0.1

└─┬ read-pkg@1.1.0

├─┬ load-json-file@1.1.0

│ └─┬ parse-json@2.2.0

│ └── error-ex@1.3.1

└─┬ normalize-package-data@2.3.6

└── hosted-git-info@2.3.1

 

 

npm ERR! Please include the following file with any support request:

npm ERR! /Users/xxx/npm-debug.log

解决办法就用这一条命令 : sudo npm install webpack -g 成功在全局安装了webpack;

mac终端安装webpack的时候报错Err,解决的办法 sudo npm install webpack -g的更多相关文章

  1. 安装vue-cli时-4058报错的解决方法

    一.报错信息 安装vue-cli时-4058报错 二.解决办法 1.安装淘宝镜像 npm --registry https://registry.npm.taobao.org info undersc ...

  2. 【adb命令】在cmd窗口中使用adb install命令安装 中文名字apk报错的解决办法

    1.在cmd窗口中使用adb install命令安装中文名字apk报错,安装英文名字apk就正常,详细报错如下图: 2.查看adb版本号:adb version 3.怀疑是adb版本的原因,尝试换个最 ...

  3. 安装Oracle JDK 7.0与8.0 for Mac OS X后Eclipse启动报错的解决之道

    启动 Eclipse 时,直接报错The JVM shared library "/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Cont ...

  4. Mac 下使用brew install 报错: Cowardly refusing to `sudo brew install'

    Mac 下使用brew install 报错: localhost:infer-osx-v0.6.0 admin$ sudo brew install opam Error: Cowardly ref ...

  5. Pycharm安装opencv与 无法安装PIL以及安装Pillow之后依然报错的解决办法

    Pycharm 安装opencv pycharm里自带了很方便的安装第三方库的方法,不需要自己去下载opencv包再pip install 在pycharm的File/Settings/Project ...

  6. npm install 安装项目依赖,报错ERR! Unexpected end of JSON input while parsing near的方法汇总

    问题描述: npm install 安装项目依赖的时候,有时会出现: ERR! Unexpected end of JSON input while parsing near 错误 原因: npm 的 ...

  7. mac下安装mysql 连接时候报错 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    http://segmentfault.com/q/1010000000094608 同样的问题,先在网上搜了下其他人解决这个问题的方法,是去修改mysql.cnf文件添加mysql.sock文件路径 ...

  8. 安装Nginx的各种报错的解决

    如题,本人环境Ubuntu14.0虚拟机,安装一个nginx服务器来运行我的fastDfs文件管理的.但是安装出现了各种问题: sudo ./configure --prefix=/usr/local ...

  9. webpack编译sass报错找不到module /css-loader/index.js... || 安装node-sass报错

    今天无论在家还是在公司,安装node-sass总是失败,或安装成功了,使用webpack编译sass报错,说找不到module,按照提示的错误我找了node_modules下的css-loader,发 ...

随机推荐

  1. 使用Python中PIL图形库进行截屏

    目的:通过使用Python的一个图形库PIL(Python Image Library)对屏幕进行截图 步骤: 1.下载PIL(路径)并安装 2.新建文件“截屏.py”,右键Edit with IDL ...

  2. PHP的输出缓冲区(转)

    什么是缓冲区?简单而言,缓冲区的作用就是,把输入或者输出的内容先放进内存,而不显示或者读取.至于为什么要有缓冲区,这是一个很广泛的问题,如果有兴趣,可以在网山找下资料.其实缓冲区最本质的作用就是,协调 ...

  3. WebDAV 配置及相关工具

    最近在项目中安装和调试服务器,杯具的是,服务器是内网地址,而且不可以直接SSH.SFTP,只能通过中间一台linux作为跳板,然后在SSH命令行里去操作目标机器. 如果只是命令行操作也就无所谓了,但是 ...

  4. HTTP02--Http请求头及缓存知识

    一.常用工具 Linux下:curl命令,I参数可以查看http head信息. Firefox:Firebug.HttpFox 二.常见Http Head信息 三.浏览器缓存机制 使用ctrl+F5 ...

  5. BZOJ4340 : BJOI2015 隐身术

    枚举$B$串的每个后缀,统计出该后缀所有满足条件的前缀. 考虑暴力搜索,设状态$(x,y,z)$表示当前需要考虑$A$从$x$开始的后缀,$B$从$y$开始的后缀,之前部分编辑距离为$z$. 那么首先 ...

  6. (二)OJ的主要文件

    OJ搭建好了后,我们要熟悉一下OJ项目下的文件及文件夹. 首先,安装好的OJ是在目录var/www/html下. html下的php文件 这些php文件都是些主要跳转页面. admin文件夹 登录管理 ...

  7. Java 反编译工具几枚(class转java)

    1.Java Decompiler Yet another fast Java decompiler. 下载地址:http://jd.benow.ca/#jd-gui-download 一款非常简洁的 ...

  8. Git CMD - remote: Manage set of tracked repositories

    命令格式 git remote [-v | --verbose] git remote add [-t <branch>] [-m <master>] [-f] [--[no- ...

  9. 八爪鱼采集器︱加载更多、再显示20条图文教程(Xpatth、Ajax)

    每每以为攀得众山小,可.每每又切实来到起点,大牛们,缓缓脚步来俺笔记葩分享一下吧,please~ --------------------------- 由于代码布置采集器比较麻烦,又很早知道八爪鱼采 ...

  10. 【Teradata】磁盘碎片整理(ferret工具)

    DEFRAGMENTcombines free sectors and moves them to the end of a cylinder.PACKDISKfill (or packs) cyli ...