报错:Could not install from "Files\node-nvm\nvm\_npx\24604" as it does not contain a package.json file.

原因:安装node.js路径带有空格

        例:C:\Program Files\nodejs

        查看路径方法:npm config get cache

解决方法方法一:

        执行:npm config edit

        弹出文件后,将带空格的路径改写为:npm config set cache “C:\Program~1\nodejs\node_cache”–global (这是 windows 的一种路径表达方式)

解决方法方法二:

        直接执行: npm config set cache "D:\Program~1\nodejs\node_modules\npm\node_cache"--global

执行完再试试就可以了

报错:Could not install from "Files\node-nvm\nvm\_npx\24604" as it does not contain a package.json file.

原因:安装node.js路径带有空格

        例:C:\Program Files\nodejs

        查看路径方法:npm config get cache

解决方法方法一:

        执行:npm config edit

        弹出文件后,将带空格的路径改写为:npm config set cache “C:\Program~1\nodejs\node_cache”–global (这是 windows 的一种路径表达方式)

解决方法方法二:

        直接执行: npm config set cache "D:\Program~1\nodejs\node_modules\npm\node_cache"--global

执行完再试试就可以了

GitHub 加速计划 / nv / nvm
78.06 K
7.82 K
下载
nvm-sh/nvm: 是一个 Node.js 版本管理器,用于在不同的 Node.js 版本之间进行切换。它可以帮助开发者轻松管理多个 Node.js 版本,方便进行开发和测试。特点包括轻量级、易于使用、支持跨平台等。
最近提交(Master分支:1 个月前 )
da2720a4 - 11 天前
9fb9dec7 Fixes #3417 11 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐