question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module '../features.json'

See original GitHub issue
$ jake compile --trace
❯ Compiling common...

❯ Compiling full...

❯ Compiling mobile...

[18:52:44] Using gulpfile ~/projects/desktop/gulpfile.js
[18:52:44] Starting 'mobile:clean'...
[18:52:44] Finished 'mobile:clean' after 4.54 ms
[18:52:44] Starting 'mobile:static'...
[18:52:44] Using gulpfile ~/projects/desktop/gulpfile.js
[18:52:44] Starting 'full:clean'...
[18:52:44] Starting 'mobile:styles'...
[18:52:44] Finished 'full:clean' after 3.5 ms
[18:52:44] Starting 'full:static'...
[18:52:44] Using gulpfile ~/projects/desktop/gulpfile.js
[18:52:44] Starting 'common:clean'...
[18:52:44] Starting 'full:styles'...
[18:52:44] Finished 'common:clean' after 18 ms
[18:52:44] Starting 'common:static'...
[18:52:44] Starting 'common:styles'...
[18:52:44] 'mobile:styles' errored after 163 ms
[18:52:44] Error: Cannot find module '../features.json'
    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> (/home/kslimani/projects/desktop/node_modules/gulp-cssnext/node_modules/cssnext/node_modules/caniuse-api/dist/index.js:10:16)
    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)
[18:52:44] 'full:styles' errored after 160 ms
[18:52:44] Error: Cannot find module '../features.json'
    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> (/home/kslimani/projects/desktop/node_modules/gulp-cssnext/node_modules/cssnext/node_modules/caniuse-api/dist/index.js:10:16)
    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)
[18:52:44] Finished 'full:static' after 188 ms
jake aborted.
Error: Process exited with error.
    at api.fail (/usr/lib/node_modules/jake/lib/api.js:336:18)
    at null.<anonymous> (/usr/lib/node_modules/jake/lib/utils/index.js:136:9)
    at emit (events.js:98:17)
    at ChildProcess.<anonymous> (/usr/lib/node_modules/jake/lib/utils/index.js:219:20)
    at ChildProcess.emit (events.js:98:17)
    at Process.ChildProcess._handle.onexit (child_process.js:810:12)
[18:52:44] 'common:styles' errored after 176 ms
[18:52:44] Error: Cannot find module '../features.json'
    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> (/home/kslimani/projects/desktop/node_modules/gulp-cssnext/node_modules/cssnext/node_modules/caniuse-api/dist/index.js:10:16)
    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)
kslimani@df3:~/projects/desktop (master)$ [18:52:44] Finished 'mobile:static' after 236 ms
[18:52:44] Finished 'common:static' after 287 ms

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:38

github_iconTop GitHub Comments

2reactions
simplesthingcommented, Mar 30, 2016

I was having same issue for different reason. If you install with npm i --ignore-scripts you will also get this error and need to manually run the postinstall hook after installing. Maybe this helps someone else doing the same.

2reactions
jclemcommented, Oct 16, 2015

I have had the same issues with Node v4.2.1 on Ubuntu 14.04. I had to manually run node dist/generate-features.js in order for this to stop happening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

require a json file results in an error: Cannot find module
I had a similar problem when trying to import json from a file in a typescript project. I used
Read more >
Solved: "Cannot find module 'x.json'" TypeScript Error
When trying to import a JSON file in your TypeScript project, you may see the following error: Cannot find module 'my-json-file.json'.
Read more >
Fixing The "Cannot Find Module" Error In TypeScript
In this article, I explain how to fix "cannot find module" in TypeScript. Install the package. Re-install the dependencies.
Read more >
Error: cannot find module [Node npm Error Solved]
How to Fix the "cannot find module" Error · delete the node modules folder by running rm -rf node_modules · delete package.lock.json file...
Read more >
Error: Cannot find module in JavaScript [SOLVED]
We can solve Error: Cannot find module by installing the missing module. We can use npm tool to install the mising module.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found