question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE during install-node-and-npm

See original GitHub issue

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

[INFO] --- frontend-maven-plugin:1.2:install-node-and-npm (install-node-and-npm) @ am-theme ---
[INFO] Node v4.6.0 was installed, but we need version v6.9.1
[INFO] Installing node version v6.9.1
[INFO] Unpacking C:\Users\mriehema\.m2\repository\com\github\eirslett\node\6.9.1\node-6.9.1-win-x64.zip into C:\dev\node\tmp
[INFO] Copying node binary from C:\dev\node\tmp\node-v6.9.1-win-x64\node.exe to C:\dev\node\node.exe
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:02 min
[INFO] Finished at: 2016-11-15T15:57:03+01:00
[INFO] Final Memory: 560M/1470M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.2:install-node-and-npm (install-node-and-npm) on project am-theme: Execution install-node-and-npm of goal com.github.eirslett:frontend-maven-plugin:1.2:install-node-and-npm failed. NullPointerException -> [Help 1]

If the current behavior is a bug, please provide the steps to reproduce.

  • Install node 4.x via frontend-maven-plugin with explicit npmVersion
  • Change version in pom.xml to 6.91without npmVersion
  • Run mvn install again

What is the expected behavior?

The old one should be replaced.

Please mention your frontend-maven-plugin and operating system version.

  • Win7, x64
  • frontend-maven-plugin 1.2
  • JDK8
  • Maven 3.3.9

Old Config:

        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>1.1</version>
          <configuration>
            <nodeVersion>v4.6.0</nodeVersion> <!-- LTS -->
            <npmVersion>3.10.8</npmVersion>
          </configuration>
          <executions>
              <execution>
                <id>install-node-and-npm</id>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
              </execution>
            </execution>
        </plugin>

New config:

        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>1.2</version>
          <configuration>
            <nodeVersion>v6.9.1</nodeVersion><!-- LTS -->
            <!-- use bundled npm -->
          </configuration>
          <executions>
              <execution>
                <id>install-node-and-npm</id>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
              </execution>
            </execution>
        </plugin>

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mriehemacommented, Dec 1, 2016

You can delete the node folder manually as a workaround. But we should fix this.

1reaction
chrisrinkcommented, Aug 1, 2017

This looks like an issue with the File.renameTo() method.

frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/NodeInstaller.java:222

I see a comment in stackoverflow to try File.move()

String fileName = "MyFile.txt";

try {
    Files.move(new File(fileName).toPath(), new File(fileName).toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
} catch (IOException ex) {
    Logger.getLogger(SomeClass.class.getName()).log(Level.SEVERE, null, ex);
}

https://stackoverflow.com/questions/1000183/reliable-file-renameto-alternative-on-windows.

Not sure if anyone has tried this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npe - npm
Node Package Editor: a CLI for one-off inspection and editing of properties in ... Start using npe in your project by running `npm...
Read more >
npe - npm Package Health Analysis - Snyk
What is npe? Node Package Editor: a CLI for one-off inspection and editing of properties in package. json files. Visit Snyk Advisor to...
Read more >
CodeMix - NPE during Terminal+ initialization - Genuitec
In Eclipse I see nothing installed, which can match this abbreviation. After NPE, Terminal+ can be opened, but commands like 'npm' or 'node' ......
Read more >
npm install cmd can trigger nexus NPE and 500 status when ...
For instance, npm client tried to install an app and here's the output collected in the Nexus logs. Have you seen this before?...
Read more >
balenalib/npe-x500-m3-debian-node - Docker Image | Docker Hub
It will install the named packages with smallest number of dependencies (ignore ... Node.js applications are written in JavaScript and can be run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found