我在一个全新的Laravel up中安装了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
我成功地安装了蒸汽。创建了一个新项目,并将域设置保留为默认设置。
您没有指定您的主机操作系统是什么,但我认为它是windows,当您运行"流浪者"时,您是作为管理员这样做的吗?
也就是说,这是npm的问题,而不是Vapor的问题。我会在流浪者控制台中运行"npmci&&npmrunprod&&rm-rf-node_modules"命令ssh,并从那里进行故障排除。
您可能没有为此项目配置节点包管理器。从你的电脑,而不是家里,如果你正在使用,运行这个命令
<project directory>: npm install
这将创建必要的文件。