从pom.xml运行npm install时出错

时间:2018-01-29 13:00:32

标签: java node.js maven npm npm-install

我创建了java项目,在pom.xml中我添加了部分来运行npm install

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
            <!--node modules are in the project. no need for npm install-->
            <execution>
                <id>npm install my</id>
                <goals>
                    <goal>exec</goal>
                </goals>
                <phase>generate-sources</phase>
                <configuration>                         
                    <executable>npm</executable>
                    <workingDirectory>${project.basedir}/../</workingDirectory>
                    <arguments>
                        <argument>install</argument>
                    </arguments>
                </configuration>
            </execution>
        </executions>
    </plugin>

我在根文件夹中创建了package.json。     依赖关系来自内部关系,而不是公共连接

"dependencies": {
 "@test/my": "1.0.13"


        },

当我在java模块上运行mvn时出现错误

意外的令牌&lt;在解析'

附近时,在位置0的JSON中

我认为这个错误与它没有找到.npmrc有关。 我试着将它添加到不同的级别中 我如何在需要.npmrc的pom.xml中定义? 为什么npm不寻找.npmrc?

0 个答案:

没有答案