npm ERR: Could not install from "Files pm-cache"

摘要:
E: 程序文件pm缓存\ _ logs2020-06-17T10_ 04_ 16_ 773Z调试。['的日志安装create-react-app@latest']failedwithcode1```#分析可以从路径推断,预期路径应为“E:ProgramFilespm cache”。此路径包含一个空格,这应该是程序错误的原因。通过“npmconfiggetcache”查看npm的缓存路径设置。的确,“E:ProgramFilespm cache”#绕过了编辑路径,可以在不更改路径的情况下完成。

# 报错了

```

E:Code est>npx create-react-app my-react-app
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Files pm-cache\_npx7920" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! E:Program Files pm-cache\_logs2020-06-17T10_04_16_773Z-debug.log
Install for [ 'create-react-app@latest' ] failed with code 1

```

# 分析

通过路径可以推断,预期路径应该是"E:Program Files pm-cache"。这个路径中包含一个空格,应该是引发程序错误的原因。

通过`npm config get cache` 查看 npm 的 cache 路径设置,确实是`E:Program Files pm-cache`

# 规避

编辑路径,在不改变路径的情况下也能办到。

1、npm config edit

2、将带空格的路径改写为:E:Progra~1 pm-cache (这是 windows 的一种路径表达方式)

免责声明:文章转载自《npm ERR: Could not install from "Files pm-cache"》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇初学Python常见异常错误,总有一处你会遇到!mysql的concat函数内部字段有null值时下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

ubuntu学习笔记

20210907: 镜像使用: ubuntu-21.04-desktop-amd64.iso 默认root用户未开启、不登录 sudo su sudo passwd root apt-get install vim sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 增加: greeter-s...

Mac安装PHP运行环境

先安装brew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" nginx的安装与配置 brew install nginx 修改配置文件 sudo vim /usr/local/etc/nginx/nginx.conf #修...

EACCES: permission denied,mkdir … npm install 安装依赖问题解决

强哥最近在用hugeGraph图库做二次开发的时候,在打包的时遇到前端项目打包失败的问题: cwebp-bin@4.0.0 postinstall /home/hugegraph/my-hugegraph-studio/studio-ui/node_modules/cwebp-bin> node lib/install.js ⚠ EACCES: pe...

HAProxy安装文档

HAProxy安装文档 目录 HAProxy安装文档 一、环境说明 二、安装配置 1.创建用户 2.安装 3.创建配置文件和启动文件 三、编辑配置文件 四、启动HAproxy 五、配置日志 1.配置rsyslog 2.创建haprxoy日志配置 3.开启远程日志 4.haproxy开启日志配置 5.重启rsyslog 和 haproxy 6....

IIS 5.0/5.1 进程回收

IIS 5.0 Process Recycling Tool,IIS5Recycle 是作为一项服务运行在运行着 Windows 2000 和 Internet Information Services (IIS) 5.0 的计算机上的。 IIS5Recycle 的目的是要重复利用过程,在资源消耗问题影响到性能和可靠性之前将其影响降到最小程度。 这一工具可...

protobuf编译

win10   cmake   vs2017编译 protobuf编译 cmake Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.19042. The C compiler identification is MSVC 19.15.26732.1 The CXX com...