解决checkPermissions Missing write access to

简介: 解决checkPermissions Missing write access to

前言


在使用 npm install 命令时,我们可能会遇到因为没有写访问权限,导致安装失败的情况。

npm WARN checkPermissions Missing write access to /Users/frankie/Documents/Project-React/demo/node_modules/decode-uri-component


正文


解决方向


  1. (基本没用)第一个反应,使用 sudo npm install,然而这种方式多数情况下并不能解决。


  1. (不推荐)使用 cnpm install,这种方式基本能解决,但不推荐。


我现在基本不用 cnpm 了,可以通过 npm config set registry https://registry.npm.taobao.orgnpm 命令下载源地址改成淘宝镜像。

为什么不推荐使用 cnpm,以及如何设置 npm 淘宝源地址,可以看下这篇文章

  1. (亲测有效)删除 node_modules 文件夹,然后重新执行 npm install
  2. (亲测有效)修改 node_modules 文件夹(或者项目目录)读写权限为 777


# 设置文件夹权限为 777
 $ sudo chmod -R 777 your_folder


题外话


关于 Linux、Mac 系统的 644、755、777 权限,可以看这篇文章

目录
相关文章
EnvironmentNotWritableError: The current user does not have write permissions to the targe...
EnvironmentNotWritableError: The current user does not have write permissions to the targe...
1967 0
|
Web App开发 存储
解决 Failed to read the ‘localStorage‘ property from ‘Window‘: Access is denied...
解决 Failed to read the ‘localStorage‘ property from ‘Window‘: Access is denied...
898 0
|
Linux
Specified sample format -1 is invalid or not supported
Specified sample format -1 is invalid or not supported
263 0
Specified sample format -1 is invalid or not supported
|
Web App开发
Failed to read the ‘localStorage‘ property from ‘Window‘: Access is denied ...
Failed to read the ‘localStorage‘ property from ‘Window‘: Access is denied ...
1284 0
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1862 0
|
网络虚拟化
使用ChatGPT Access denied,Error reference number: 1020问题解决
使用ChatGPT Access denied,Error reference number: 1020问题解决
使用ChatGPT Access denied,Error reference number: 1020问题解决
使用 spritesmith 报错 Error: Invalid file signature
使用 spritesmith 报错 Error: Invalid file signature
147 0
使用 spritesmith 报错 Error: Invalid file signature
When allowCredentials is true, allowedOrigins cannot contain the special value ___ since that cannot be set on the _Access-Contr
When allowCredentials is true, allowedOrigins cannot contain the special value ___ since that cannot be set on the _Access-Contr
709 1