Error running Gulp in Sylius - npm

I've got a new install of Sylius that I'm working with. I just installed NPM and Gulp, and wanted to run Gulp for the first time. I'm getting an error, and have never worked with Gulp or Sylius before, so it's a little hard for me to understand:
gulp
module.js:328
throw err;
^
Error: Cannot find module 'gulp-if'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/var/www/mysite.com/public_html/Gulpfile.js:2:14)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
This is happening on a Ubuntu system, but it also seems to be throwing the same error on my Mac, with a copy of the same Sylius install on it.

try running npm i -S gulp-if in your project. What this does is install the gulp-if package and saves it in your package.json file

Related

Vue Cli: Cannot find module '../package.json' error after npm install

I am not an expert in Vuejs or Vuecli, but I do manage to get stuff working.
I had a project i worked on before using Vuecli3 and webpack and now when I opened it after few weeks to make changes, i get the below error in dev mode
$ vue-cli-service serve --open --mode development --dashboard
internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module '../package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Volumes/Drobo/Dropbox/NASDAQ Dubai/Marketdata-6-Indices/node_modules/.bin/vue-cli-service:5:25)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
Total task duration: 0.15s
The package.json file is right there in the root director and also the .lock file. Dont know what is the reason for this error in compiling.
Any help hightly appreciated
As #vesperknight mentioned in the comment, this issue tends to happen when you move the project's folder to another location.
To solve this (on Linux), from the root directory of your project:
Delete existing node modules.
rm -r node_modules
Reinstall all dependencies:
npm install
The first step seems to be important.

Error with chalk module installing Vue-cli

Configuring VUE-CLI I am having the next problem:
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/local/bin/vue:3:15)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
I have tried to install the module globally but with the same result, when I type in the terminal vueerror appears again.
Could you tell me please how to fix this problem?
It was fixed adding the correct PATHS in the .zshrc file, I was adding them to the bash_profile but I am working with other shell.
see the error "Error: Cannot find module 'chalk'"
try
npm install chalk

Error: Cannot find module 'wrappy'

When I try to restore my packages via yarn I'm receiving the following error:
npm run yarn --ignore-platform --ignore-optional
...
error C:\Users\mdepouw\source\repos\MyRepo\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: C:\Users\mdepouw\source\repos\MyRepo\node_modules\node-sass
Output:
module.js:471
throw err;
^
Error: Cannot find module 'wrappy'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\mdepouw\source\repos\MyRepo\node_modules\inflight\inflight.js:1:76)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
When I a npm install it works fine.
Why does one work but not the other?
This usually happens when you update npm. To resolve this go to path "C:\Users[username]\AppData\Roaming" and delete "npm" and "npm-cache" folders. Then uninstall nodejs and reinstall using updated installer. This should solve your problem.

Cloud9 NPM update error "Cannot find module 'npm log'"

Good morning!
I started a new project this morning on Cloud9, and when running "npm init", it prompted an update which I ran.
It seemed to install fine, but now when I went to "npm install" some packages, it returns the following error:
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at /home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/bin/npm-cli.js:22:13
at Object.<anonymous> (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/bin/npm-cli.js:92:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
Any ideas on if this is a Cloud9 bug or if it's fixable?
Many thanks in advance!
I just had this very same issue with the update. I'm guessing there's some cloud9 specific issue with the way the update is handled. Ran the link below and it seems to have resolved the issue. Able to check the version and install packages now.
npm config delete prefix
Hope it helps.

Visual Studio Team Services: GULP build task failing on 'CANNOT FIND MODULE'

I am trying to set up a CI for my project team. I am pushing an angular/node project to a git repo in Team Services. The build triggers fine until it hits the gulp task. Before that gulp task run steps 1-3:
1. npm config set cache C:\Dev\nodejs\npm-cache --global
2. npm install
3. npm cache clean
**4. gulp default**
5. deploy to azure
The reasons for steps 1 & 2 is because npm install was failing until i set the cache.
my error output:
2016-04-28T17:51:21.0694993Z [command]C:\NPM\Modules\gulp.cmd default --gulpfile C:\a\1\s\PolicyUI\PolicyUI\gulpfile.js --packagePath=C:\a\1\a
2016-04-28T17:51:25.1707118Z module.js:338
2016-04-28T17:51:25.1707118Z throw err;
2016-04-28T17:51:25.1717126Z ^
2016-04-28T17:51:25.1717126Z Error: Cannot find module 'merge-stream'
2016-04-28T17:51:25.1717126Z at Function.Module._resolveFilename (module.js:336:15)
2016-04-28T17:51:25.1727127Z at Function.Module._load (module.js:278:25)
2016-04-28T17:51:25.1727127Z at Module.require (module.js:365:17)
2016-04-28T17:51:25.1738110Z at require (module.js:384:17)
2016-04-28T17:51:25.1747120Z at Object.<anonymous> (C:\a\1\s\PolicyUI\PolicyUI\gulpfile.js:8:13)
2016-04-28T17:51:25.1747120Z at Module._compile (module.js:460:26)
2016-04-28T17:51:25.1757124Z at Object.Module._extensions..js (module.js:478:10)
2016-04-28T17:51:25.1757124Z at Module.load (module.js:355:32)
2016-04-28T17:51:25.1767126Z at Function.Module._load (module.js:310:12)
2016-04-28T17:51:25.1767126Z at Module.require (module.js:365:17)
merge-stream IS there locally and works fine on my machine.
Does anyone know why this fails???
Whenever a build happens in team services, is that an isolated powershell environment where it is building??
We had a similar issue in our team. We had to modify the powershell script manually to point to the right location of the gulp file. There were some path issues in the default script provided. Please look into it and you may find some answers.
Thank you.