0

我在一个全新的 Laravel 中安装了 Vapor。当我尝试运行“蒸汽部署生产”时,我收到此错误:

Running Command: npm ci && npm run prod && rm -rf node_modules
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log

In Process.php line 254:

  The command "npm ci && npm run prod && rm -rf node_modules" failed.

  Exit Code: 1(General error)

  Working directory: /home/vagrant/code/sales2/.vapor/build/app

  Output:
  ================


  Error Output:
  ================
  npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVers
  ion >= 1. Run an install with npm@5 or later to generate it, then try again.

  npm ERR! A complete log of this run can be found in:
  npm ERR!     /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log

我成功安装了蒸汽。创建了一个新项目并将域设置保留为默认值。

4

2 回答 2

0

您没有指定您的主机操作系统是什么,但我假设它是 Windows,当您运行“vagrant up”时,您是否以管理员身份这样做?

也就是说,这是 npm 而不是 Vapor 的问题。我会在您的 vagrant 控制台中运行“npm ci && npm run prod && rm -rf node_modules”命令 ssh 并从那里进行故障排除。

于 2019-11-06T16:05:16.527 回答
0

您可能没有为此项目配置节点包管理器。如果您正在使用,请从您的计算机而不是宅基地运行此命令

<project directory>: npm install

这将创建必要的文件。

于 2021-05-10T04:14:47.227 回答