我正在尝试根据以下文档安装MarkLogic Glove。
Quick Creation of a new Grove project
但是用于启动Grove项目的'npm start'命令失败。 我实际执行的步骤如下
1)安装grove-cli
# npm install -g @marklogic-community/grove-cli
/usr/bin/grove -> /usr/lib/node_modules/@marklogic-community/grove-cli/index.js
+ @marklogic-community/grove-cli@1.0.1
added 79 packages from 60 contributors in 8.768s
2)生成一个新项目
# mkdir -p /var/opt/groveprj
# cd /var/opt/groveprj
# grove new testprj01
? Please confirm the name of your new project testprj01
? Do you want to create your Grove project with the React or the Vue UI? React
Congratulations, you successfully generated a new Grove project.
:
Log into your application using any MarkLogic user with sufficient permissions.
3)配置项目“ testprj01”
# cd testprj01
# grove config
? What host is your instance of MarkLogic running on? [*IP address which MarkLogic is listening*]
? What port do you want to use for your MarkLogic REST server? [*Port number which MarkLogic is listening*]
? What port do you want your Grove Node server to listen on? 9003
4)设置MarkLogic
# cd marklogic
# ./gradlew mlDeploy
:
BUILD SUCCESSFUL in 3m 36s
5)安装npm依赖项
# cd ..
# npm install
npm WARN lifecycle @marklogic-community/grove-react-template@1.0.0~postinstall: cannot run in wd @marklogic-community/grove-react-template@1.0.0 node scripts/postinstall.js (wd=/var/opt/groveprj/testprj01)
added 45 packages from 35 contributors and audited 51 packages in 2.432s
found 2 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
由于显示了以上消息,因此在我执行了“ npm audit fix”并再次执行“ npm install”之后
# npm audit fix
updated 1 package in 1.029s
fixed 2 of 2 vulnerabilities in 51 scanned packages
# npm install
npm WARN lifecycle @marklogic-community/grove-react-template@1.0.0~postinstall: cannot run in wd @marklogic-community/grove-react-template@1.0.0 node scripts/postinstall.js (wd=/var/opt/groveprj/testprj01)
audited 51 packages in 0.888s
found 0 vulnerabilities
6)启动服务器
# npm start
此时,将显示以下消息,并且npm启动失败。
[1]
[1] > @marklogic-community/grove-react-template@1.0.0 ui /var/opt/groveprj/testprj01
[1] > cd ui && npm start
[1]
[0]
[0] > @marklogic-community/grove-react-template@1.0.0 middleTier /var/opt/groveprj/testprj01
[0] > cd middle-tier && npm start
[0]
[1]
[1] > @marklogic-community/grove-react-ui@1.0.0 start /var/opt/groveprj/testprj01/ui
[1] > react-scripts start
[1]
[1] sh: react-scripts: command not found
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! syscall spawn
[1] npm ERR! file sh
[1] npm ERR! errno ENOENT
[1] npm ERR! @marklogic-community/grove-react-ui@1.0.0 start: `react-scripts start`
[1] npm ERR! spawn ENOENT
:
似乎无法正确安装react-scripts。
我使用的环境如下
操作系统版本:CentOS 7.4
MarkLogic版本:9.0-11
Node.js版本:v13.5.0
npm版本:6.13.4
Java版本:1.8.0_231