我有一個Docker容器無法為react.js應用程式執行npm安裝,該應用程式在構建時克隆在容器中.有人知道如何解決這個問題嗎?
錯誤:
sh: 1: react-scripts: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-06-19T04_00_09_065Z-debug.log
Dockerfile:
FROM ubuntu
Run apt-get update
Run apt-get install curl -y
Run curl -sL https://deb.nodesource.com/setup_10.x
Run apt-get install -y nodejs
Run apt-get install -y git
Run apt-get install npm -y
Run apt-get update -y
Run git clone https://github.com/sdrafahl/TerraWeb.git
WORKDIR /TerraWeb
Run npm install -g --save npm@latest
...
uj5u.com熱心網友回復:
我有類似的問題,我設法改變:“start:”react-scripts start“
至:
“start:”./ node_modules / .bin / restart-scripts開始“
在腳本部分package.json中.
我使用經典節點基礎映像,但它應該或多或少相同.我仍在調查為什么NPM在Docker中運行時無法決議反應腳本,非常歡迎任何進一步的幫助:-)
uj5u.com熱心網友回復:
您好 , 請問您解決這個問題了嗎,我最近也遇見了轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/76582.html
標籤:其他技術討論專區
上一篇:ssis 連接Oracle與sqlserver,報錯資訊,在線求助
下一篇:請教一篇關于演算法的論文
