Gulp cannot find gulp-riot
juriansluiman opened this issue · comments
After the new version (which should fix the compile crash, many thanks!), gulp (or npm) can't find gulp-riot anymore.
My package.json relevant section
$ cat package.json | grep riot
"gulp-riot": "^0.1.3",
My gulpfile.js relevant section
gulp.src('public/scripts/src/comments.tag')
.pipe(riot())
.pipe(chmod(644))
.pipe(gulp.dest('public/scripts/dist'));
The output from gulp
:
$ gulp
Error: Cannot find module 'gulp-riot'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/vagrant/gulpfile.js:5:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
What I found is perhaps a strange directory output, as ./node_modules/gulp-riot
is practically empty, not containing a build/
folder:
$ tree -a -L 3 node_modules/gulp-riot/
node_modules/gulp-riot/
├── node_modules
│ ├── .bin
│ │ └── riot -> ../riot/compiler/index.js
│ ├── gulp-util
│ │ ├── index.js
│ │ ├── lib
│ │ ├── LICENSE
│ │ ├── node_modules
│ │ ├── package.json
│ │ └── README.md
│ ├── riot
│ │ ├── compiler
│ │ ├── node_modules
│ │ ├── package.json
│ │ ├── README.md
│ │ ├── riot.js
│ │ └── riot.min.js
│ └── through2
│ ├── LICENSE
│ ├── node_modules
│ ├── .npmignore
│ ├── package.json
│ ├── README.md
│ └── through2.js
├── .npmignore
├── package.json
├── powered-test
│ └── index.js
└── README.md
11 directories, 18 files
NB. If you wonder, I did an npm cache clean
and then npm install gulp-riot
, so I am quite sure I installed gulp-riot. It isn't because I forgot to install the component ;) But perhaps I did something else wrong?
Works fine in my environment.
✈ tree -L 3
.
├── build
│ └── test.js
├── gulpfile.coffee
├── node_modules
│ ├── coffee-script
│ │ ├── CNAME
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── README
│ │ ├── README.md
│ │ ├── bin
│ │ ├── lib
│ │ ├── node_modules
│ │ ├── package.json
│ │ ├── register.js
│ │ └── repl.js
│ ├── gulp
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── bin
│ │ ├── completion
│ │ ├── index.js
│ │ ├── lib
│ │ ├── node_modules
│ │ └── package.json
│ └── gulp-riot
│ ├── README.md
│ ├── build
│ ├── node_modules
│ ├── package.json
│ ├── powered-test
│ └── wercker.yml
└── test.tag
✈ cat gulpfile.coffee
gulp = require 'gulp'
riot = require 'gulp-riot'
gulp.task 'riot', ->
gulp.src 'test.tag'
.pipe riot()
.pipe gulp.dest 'build'
✈ gulp riot
[00:45:10] Requiring external module coffee-script/register
[00:45:10] Using gulpfile ***/gulpfile.coffee
[00:45:10] Starting 'riot'...
[00:45:10] Finished 'riot' after 10 ms
✈ cat test.tag
<sample>
<p>test { sample }</p>
this.sample = 'sample'
</sample>
✈ cat build/test.js
riot.tag('sample', '<p>test { sample }</p>', function(opts) {
this.sample = 'sample'
});
Can you tell full gulpfile.js
? Something missed it?
Or
$ rm -rf node_modules
$ npm i gulp gulp-riot
maybe will resoleve
Closing for now, as I created a dummy project with nothing more than gulp+gulp-riot and a single custom.tag
file. This does work as expected.
I will check out what is wrong with my files from the project I initially opened this issue for. If I still find something that is related to gulp-riot, I will open the issue again :)
🙆♀️
For this issue I did a cache clean and install like 10 times or so, but an npm update simply resolved the issue 😮
OMG 👍