Using NetBeans 8.2, I've created a new Maven web application. I have placed a working package.json
file inside the Web Pages
folder so its path is:
C:\Users\xxx\Documents\NetBeansProjects\MyApp\src\main\webapp\package.json
I left click on the package.json
file and click the npm install
option. I was then greeted by these errors/warnings:
"C:\Program Files\nodejs\npm.cmd" "install"
npm WARN ENOENT ENOENT: no such file or directory, open 'C:\Users\Nick\Documents\NetBeansProjects\MyApp\package.json'
npm WARN EPACKAGEJSON C:\Users\xxx\Documents\NetBeansProjects\MyApp No description
npm WARN EPACKAGEJSON C:\Users\xxx\Documents\NetBeansProjects\MyApp No repository field.
npm WARN EPACKAGEJSON C:\Users\xxx\Documents\NetBeansProjects\MyApp No README data
npm WARN EPACKAGEJSON C:\Users\xxx\Documents\NetBeansProjects\MyApp No license field.
Done.
I noticed NetBeans attempted to look for the package.json file at the wrong place:
C:\Users\Nick\Documents\NetBeansProjects\MyApp\package.json'
And I can't seem to figure out how to tell the IDE where to look for it.
When I go to Project Properties → JavaScript Libraries → npm, I get an empty view with :
package.json not found
How can I set up NetBeans to see that 'package.json' and run it? It worked fine when I tried using it in an HTML5 project, but I need npm support for a Java web application project.