【问题标题】:Vue CLI project setup throws ENOENT: no such file or directory errorVue CLI 项目设置抛出 ENOENT: no such file or directory 错误
【发布时间】:2020-08-14 02:38:31
【问题描述】:

我正在尝试创建一个新的 Vue.js 应用程序并且我正在运行命令:

vue create client

接下来我选择默认模板:

default (babel, eslint) 

但是,在设置完成之前,它会退出并出现以下错误:

✨  Creating project in /workspace/client.
⚙️  Installing CLI plugins. This might take a while...

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /workspace/client/node_modules/.inquirer.DELETE/node_modules/ansi-styles
npm ERR! dest /workspace/client/node_modules/inquirer/node_modules/ansi-styles
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/workspace/client/node_modules/.inquirer.DELETE/node_modules/ansi-styles' -> '/workspace/client/node_modules/inquirer/node_modul
es/ansi-styles'
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!     /root/.npm/_logs/2020-04-29T20_47_33_239Z-debug.log

我正在使用节点 12 的 docker 容器内进行开发。
我的问题是:我该如何解决这个问题?另外,这是与 Docker 相关的问题吗?

【问题讨论】:

  • 是 Windows 上的 Docker 吗?如果是这样,它是否具有访问磁盘的权限/共享
  • 是的,Docker for Windows(Docker Desktop),我相信是的,因为我只有 C 盘,而且它被标记了
  • 我遇到过类似的问题,这与 docker 与文件系统交互的方式有关。我的更多是关于将 windows 容器安装到 docker 容器中,但这是一个类似的错误
  • 您是否在 docker 容器内运行 vue create client ?我一直使用 docker-compose 所以需要运行docker-compose run containername vue create client
  • 我正在使用 vscode 和一个名为“remote-containers”的扩展,我相信它确实连接到容器并运行命令,就像在 docker 中使用 -it 选项运行命令一样

标签: node.js docker vue.js vue-cli


【解决方案1】:

重新安装 Node.js,然后尝试安装 Vue https://nodejs.org/en/

【讨论】:

    猜你喜欢
    • 2017-08-23
    • 2018-04-24
    • 2016-11-01
    • 1970-01-01
    • 2022-07-12
    • 1970-01-01
    • 2020-03-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多