由于某些原因,我们有一些使用---
title: "asdf"
author: "asdf"
date: "29-1-2020"
output: html_document
---
$$min\limits_{f}(.)\left \{ \right\sum_{n}^{i=1} \left ( y^{_{i}}-f\left ( x_{i} \right ) \right )^2 + \lambda \int \left ( f''(x) \right )^2 dx\}$$
构建的React项目。
关键是,我们曾经使用maven
运行一个Maven插件,一切都很好。
最近,我们决定改善构建过程并使用npm install
,以便所有版本都将得到修复。
从那时起,每次构建项目时,我们都会看到以下错误:
npm ci
- 如果我们在项目文件夹中手动
[INFO] > fsevents@1.2.11 install /home/username/applications/react/magnificent-app-name/src/main/frontend/node_modules/fsevents [INFO] > node-gyp rebuild [INFO] [INFO] internal/modules/cjs/loader.js:584 [INFO] throw err; [INFO] ^ [INFO] [INFO] Error: Cannot find module 'graceful-fs' [INFO] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
运行,则没有错误。 - 如果我们在项目文件夹中手动
npm install
运行,则没有错误。 - 如果我们通过maven插件运行
npm ci
,则不会出错。 - 如果我们通过Maven插件运行
npm install
,则会出现上述错误。
在阅读了一些相关的github问题之后,我们还尝试了npm ci
,但是它没有任何改变。
我们重新安装了npm。
我们清除了缓存。
互联网上我们几乎做了任何事情。
不过,npm ci --no-optionals
。
maven插件定义,以防万一:
Cannot find module 'graceful-fs'
我们正在使用<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>ci --no-optionals</arguments>
</configuration>
</execution>
<execution>
<id>npm build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build -- --env.conf ${build.profile.id} --env.mvn</arguments>
</configuration>
</execution>
</executions>
<configuration>
<nodeVersion>${node.lts.version}</nodeVersion>
<installDirectory>../node_installation</installDirectory>
<workingDirectory>src/main/frontend</workingDirectory>
</configuration>
</plugin>
</plugins>
</build>
。
有什么想法吗?