Access error when installing packages

一、环境说明

        操作系统:windows7

        命令操作环境:cygwin


二、错误说明

       在npm install grunt是出现报错:

npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\ignore-by-default
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\livereload-js
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\lodash.defaults
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\minimatch
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\globule
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\gaze
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\chokidar
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\ps-tree
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\undefsafe
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\touch
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\faye-websocket
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\tiny-lr
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\nodemon
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\update-notifier
npm WARN checkPermissions Missing write access to G:\webstorm\movieManageWeb\node_modules\glob
npm WARN moviemanageweb@1.0.0 No description
npm WARN moviemanageweb@1.0.0 No repository field.

npm ERR! path G:\webstorm\movieManageWeb\node_modules\ignore-by-default
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'G:\webstorm\movieManageWeb\node_modules\ignore-by-default'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent


npm ERR! A complete log of this run can be found in:
npm ERR!     d:\Program Files\nodejs\node_cache\_logs\2017-10-19T13_36_58_890Z-debug.log


三、问题解决

后面发现是因为我之前使用的是cnpm install grunt -g

使用的是cnpm在全局下安装的grunt。

后面又使用npm在当前文件目录下安装grunt,就出现了文件权限的问题。

所以我改成使用:cnpm install grunt --save-dev

问题就解决了。

cnpm是使用淘宝镜像安装,具体配置是:

npm install -g cnpm --registry=https://registry.npm.taobao.org
然后就可以使用cnpm安装模块了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值