This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257836 - NPM & Gulp don't work
Summary: NPM & Gulp don't work
Status: RESOLVED INVALID
Alias: None
Product: javascript
Classification: Unclassified
Component: Node.js (show other bugs)
Version: 8.1
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-03 23:35 UTC by hartey11
Modified: 2016-02-23 10:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hartey11 2016-02-03 23:35:45 UTC
Hi,

Sorry if i'm reporting this in the wrong place but I can't find any resources online or info on the issues that I am having setting up Netbeans.

Basically I am trying to setup a development environment on my mac for building wordpress websites and I use MAMP PRO. All my projects are in the htdocs folder in Mamp.

I am trying to setup Netbeans to work with Gulp so I can add task for PostCSS compilation, css autoprefixer, px to rems, javascript minification and other automation tasks.

I have created the project (htdocs/project in MAMP) and created a gulp file. However when I right click and run default gulp task i get the following error:

"/bin/bash" "-lc" "\"/usr/local/bin/gulp\" \"--color\""
[23:27:19] Local gulp not found in ~
[23:27:19] Try running: npm install gulp
Done.

I have also tried right clicking and selecting npm install but get the following error:

"/bin/bash" "-lc" "\"/usr/local/bin/npm\" \"install\""
npm ERR! install Couldn't read dependencies
npm ERR! Darwin 15.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.2
npm ERR! npm  v2.12.1
npm ERR! path /Users/Jonny/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2

npm ERR! package.json ENOENT, open '/Users/Jonny/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Jonny/npm-debug.log
Done.

I have entered my Gulp Path "/usr/local/bin/gulp", Node.js Path "/usr/local/bin/node" and npm path "/usr/local/bin/npm" in preferences.

Like I previously said I can't find any instructions on setting this up, so any help getting this working or pointing me in the right direction would be very much appreciated.

Thanks in advance.
Jonny Harte
Comment 1 Tomas Mysik 2016-02-23 10:06:47 UTC
(In reply to hartey11 from comment #0)
> [23:27:19] Local gulp not found in ~
> [23:27:19] Try running: npm install gulp

This message tells you that you must have Gulp installed also locally in your project. It means that you need to have it in your project's package.json (as a dependency). You don't have it so right now, right?

> npm ERR! package.json npm can't find a package.json file in your current
> directory.

This message tells you that you did not create package.json file in your project directory.

Feel free to attach your project here but creating package.json in your project directory (NetBeans can help with that, see File > New File > HTML5/JavaScript > package.json) and adding a dependency on Gulp to it (again, NetBeans can help - open Project Properties dialog and select JavaScript Libraries > npm) should solve your problem.

You can also create a NetBeans' sample application and have a look at the project directory structure, its package.json etc. Just invoke File > New Project > Samples > HTML5/JavaScript > Knockout Messages Sample (or the Angular one) and investigate it a bit.

Thanks for reporting.