前端maven插件 - 找不到模块

时间:2017-03-25 06:14:04

标签: angularjs maven

我在项目中使用了frontend-maven-plugin。我已经在我的机器上安装了node,npm和bower。当我运行“mvn clean install”时,我收到以下错误。

  

node --version - > v5.7.1
  npm --version - > 3.6.0
  bower --version    - > 1.7.7

<plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <!-- NB! Set <version> to the latest released version of frontend-maven-plugin, 
                    like in README.md -->
                <version>1.3</version>

                <executions>

                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <!-- See https://nodejs.org/en/download/ for latest node and npm (lts) 
                                versions -->
                            <nodeVersion>v5.10.1</nodeVersion>
                            <npmVersion>3.8.3</npmVersion>
                            <!-- optional: where to download node from. Defaults to https://nodejs.org/dist/ -->
                            <nodeDownloadRoot>https://artifacts.apple.com/node-distributions/</nodeDownloadRoot>
                        </configuration>
                    </execution>

                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>

                        <!-- optional: default phase is "generate-resources" -->
                        <phase>generate-resources</phase>

                        <configuration>
                            <!-- optional: The default argument is actually "install", so unless 
                                you need to run some other npm command, you can remove this whole <configuration> 
                                section. -->
                            <arguments>install</arguments>
                        </configuration>
                    </execution>

                    <execution>
                        <id>bower install</id>
                        <goals>
                            <goal>bower</goal>
                        </goals>

                        <configuration>
                            <!-- optional: The default argument is actually "install", so unless 
                                you need to run some other bower command, you can remove this whole <configuration> 
                                section. -->
                            <!-- <workingDirectory>.</workingDirectory>
                            <installDirectory>./src/main/webapp/</installDirectory> -->
                            <arguments>install</arguments>
                        </configuration>
                    </execution>


                    <execution>
                        <id>gulp build</id>
                        <goals>
                            <goal>gulp</goal>
                        </goals>

                        <!-- optional: the default phase is "generate-resources" -->
                        <phase>generate-resources</phase>

                        <configuration>
                            <!-- optional: if not specified, it will run Grunt's default task 
                                (and you can remove this whole <configuration> section.) -->
                            <arguments>build</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

获得以下错误,

[INFO] --- frontend-maven-plugin:1.3:bower (bower install) @ cs-web ---
[INFO] Running 'bower install' in cs-web
[ERROR] module.js:341
[ERROR]     throw err;
[ERROR]     ^
[ERROR] 
[ERROR] Error: Cannot find module 'cs-web/node_modules/bower/bin/bower'
[ERROR]     at Function.Module._resolveFilename (module.js:339:15)
[ERROR]     at Function.Module._load (module.js:290:25)
[ERROR]     at Function.Module.runMain (module.js:447:10)
[ERROR]     at startup (node.js:146:18)
[ERROR]     at node.js:404:3

0 个答案:

没有答案