gulp dev says Local gulp not found when its clearly installed - node.js

It has been 8 hours since I started looking into this issue and so far I haven't made any progress.
Every time i run gulp dev I get the error
Local gulp not found in
Try running: npm install gulp
I have run npm install gulp, npm install gulp-cli, both variantes (with -g and without). I have tried to search online and I have found some people saying that I need run npm link gulp but every time I run that command I get the following in the console:
And here the process of trying to installing gulp
I dont really know what to do more.
I should say I'm running windows 10 on parallels destop. On my mac os gulp is running fine.

If you've installed gulp local to your project you're going to need to run it via an npm script. Add something like the following to your package.json
"scripts": {
"dev": "gulp dev"
}
Then run it like this
npm run dev

Found the problem. Apparently when using parallels desktop you are not able to run gulp from a shared folder, my project was running from \\Mac\Home\Documents\Git\Development\Wigo4it\GIWI\Components . What I did was moving the project from my shared folder to my C:/ inside the windows VM. And now it works. Just had some troubles with right permissions but that is solved.

Related

Run a Vue.js project in server without “ npm run dev ” command?

After installing vue cli globally by running npm install -g vue-cli, I have installed all the modules in the project folder "myBlog" by running npm install and can run the project in my local environment by using npm run dev. But when I am going to move this project in the live server is this is the right way to run the batch program (npm run dev) continuously or there are other ways to run the project without running npm run dev continuously?
If you are using the "webpack", "webpack-simple" or "pwa" template there is a dedicated command for creating the production build, which allows a static hosting (with no need to run any npm process in the server):
npm run build
It will create a dist folder which content you can upload to the root of your server.
Some more info about:
"webpack" template:
https://vuejs-templates.github.io/webpack/commands.html#npm-run-build
"webpack-simple":
https://github.com/vuejs-templates/webpack-simple#webpack-simple
"pwa": https://github.com/vuejs-templates/pwa#whats-included
It's not Vue specific but you also should be able to run npm run build which generates production bundles in /dist subfolder of your project. You are supposed to copy this folder to the production server and configure the server so that it serves dist/index.html for every URL.

npm install stuck on node lib/install.js

I'm running in an issue trying to install foundations email framework. After running the command foundation new --framework emails the installations get stuck at the point, where the terminal output says node lib/install.js.
I've tried to cancel the installation, deleting the node_modules folder and rerun the installation process via npm install => same problem.
Cancalling the process and going on with the next step (npm start), results in an error, saying that node-sass could not be find.
I'm running an Ubuntu Desktop 16.04 LTS via VirtualBox on a Windows 10 host-system. The guest system has 2048MB working storage.
Ok, it seems there was a problem with the package gifsicle. I cancelled the installation process, went to github and downloaded the gifsicle-package there. Then I put it in my node_modules/gifsicle directory and re-ran npm install.
Now npm start works without any problems.

'bower' is not recognized, want to have Jenkins install grunt, bower

I am getting the issue 'bower' is not recognized while running my Jenkins project as I have seen many other people get. However, I know I can get it to work by including the hardcoded path
C:\Users\clang\AppData\Roaming\npm
in my path environment variable. This is not the way I want to do it though.
My goal is to have this Jenkins configuration be able to download, install, and run these commands locally and be able to do so without hardcoding a path as I want it to run on other computers that would have different users hence different paths. This is my current batch script that I am running.
set PATH=%PATH%; %WORKSPACE%\.bin;
call npm install
call npm install bower
call npm install grunt-cli
call bower install
call grunt build
when bower and grunt are installed by this, the bower.cmd and grunt.cmd are located in this directory
C:\Program Files (x86)\Jenkins\workspace\ClearWork\.bin
The command I am running at the top does in fact evaluate to and include the directory where these command files are located but for some reason I am still getting the error saying that bower and grunt are not recognized.
Just to make sure it wasn't an issue with the Jenkins %Workspace% environment variable I even hard coded the location which gave the same result.
Option 1
call node_modules/.bin/bower install
call node_modules/.bin/grunt build
Option 2
Add these as scripts to the package.json:
(inside package.json)
"scripts": {
"bower:install": "bower install",
"grunt:build": "grunt build"
}
Now you should be able to call:
call npm run bower:install
call npm run grunt:build
Because npm automatically adds node_modules/.bin to the path

Setting the global NPM folder

So ultimately, I am trying to install gulp by following this tutorial http://travismaynard.com/writing/getting-started-with-gulp, and I was having a lot of problems initially. I kept getting the error that "gulp is not recognized as an internal or external command", which is confusing to me because I found that by running npm ls that gulp had been installed properly. The command wasn't being recognized even after restarting command prompt. I found an article online http://blog.webbb.be/command-not-found-node-npm/ that I may have installed gulp in my local folder other than the global node_module folder. However, when I tried to reset the npm folder with npm config set prefix usr/local/, I received errors. If anyone can walk me through getting the global NPM folder set up and getting the gulp command to work properly, that would be much appreciated.
Try running command prompt as administrator,
or sudo since you seem to be on unix,
you install a package globally by using npm -g,

How to install the Grunt task runner?

I am trying to install Grunt (on Windows).
The documentation (http://gruntjs.com/getting-started) says to install grunt-cli and explains that this is not the Grunt task runner but just the program to allow the grunt command to be run from any folder. Ok. Fine. I've done that. My next question is; how to install the Grunt task runner. The implication of the docs is that this will be installed locally in my project directory.
How do I do that?
The project already has a Gruntfile.js and a package.json & works on another machine. I'm just trying to get it run locally.
Specifically I get this message:
"... a Gruntfile wasn't found or Grunt hasn't been installed locally to your project"
Thanks
--Justin Wyllie
npm install --save-dev grunt to install it just like any module and add it to your package.json file as a development dependency.
grunt may also already be listed as a dependency, in which case you may just need to run npm install to install all dependencies.

Resources