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.

ENOENT: no such file or directory, open '.../schema/loader.json'

See original GitHub issue
  • Laravel Mix Version: #.#.# (npm list --depth=0)
├── axios@0.15.3
├── bootstrap-sass@3.3.7
├── cross-env@3.2.4
├── jquery@3.2.1
├── laravel-mix@0.12.1
├── lodash@4.17.4
└── vue@2.3.4
  • Node Version (node -v): v8.0.0
  • NPM Version (npm -v): 5.0.0
  • OS: macOS Sierra 10.12.5
  • Running locally and using php artisan serve for basic testing for now

Description:

Been having issues right from the start with a clean Laravel app running npm run dev. Decided to add some scss and run the command to see if it would all compile well and show. But despite multiple attempts, node_modules wipes and npm installs I cannot get past this error.

Steps To Reproduce:

run npm run dev for the first time, and again post npm and node upgrades and get:

> @ development /Users/jasper/webdesign/larastud.io
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
fs.js:638
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT: no such file or directory, open '/Users/jasper/webdesign/larastud.io/schema/loader.json'
    at Object.fs.openSync (fs.js:638:18)
    at Object.fs.readFileSync (fs.js:540:33)
    at validateOptions (/Users/jasper/webdesign/larastud.io/node_modules/schema-utils/dist/validateOptions.js:35:27)
    at ExtractTextPlugin.extract (/Users/jasper/webdesign/larastud.io/node_modules/extract-text-webpack-plugin/index.js:206:3)
    at Sass.rules (/Users/jasper/webdesign/larastud.io/node_modules/laravel-mix/src/Preprocessors/Preprocessor.js:46:42)
    at Mix.preprocessors.forEach.preprocessor (/Users/jasper/webdesign/larastud.io/node_modules/laravel-mix/setup/webpack.config.js:243:33)
    at Array.forEach (native)
    at Object.<anonymous> (/Users/jasper/webdesign/larastud.io/node_modules/laravel-mix/setup/webpack.config.js:242:23)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1

Well there is no schema/loader.js of course… So not sure why it is looking for that file there. Here the full log missing that same error… :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using npm@5.0.0
3 info using node@v8.0.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 silly lifecycle @~predev: no script for predev, continuing
7 info lifecycle @~dev: @
8 verbose lifecycle @~dev: unsafe-perm in lifecycle true
9 verbose lifecycle @~dev: PATH: /Users/jasper/webdesign/larastud.io/npm/bin/node-gyp-bin:/Users/jasper/webdesign/larastud.io/node_modules/.bin:/Users/jasper/.rvm/gems/ruby-2.3.3/bin:/Users/jasper/.rvm/gems/ruby-2.3.3@global/bin:/Users/jasper/.rvm/rubies/ruby-2.3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jasper/.composer/vendor/bin:/Users/jasper/.rvm/bin
10 verbose lifecycle @~dev: CWD: /Users/jasper/webdesign/larastud.io
11 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
12 silly lifecycle @~dev: Returned: code: 1  signal: null
13 info lifecycle @~dev: Failed to exec dev script
14 verbose stack Error: @ dev: `npm run development`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/Users/jasper/webdesign/larastud.io/npm/lib/utils/lifecycle.js:283:16)
14 verbose stack     at emitTwo (events.js:125:13)
14 verbose stack     at EventEmitter.emit (events.js:213:7)
14 verbose stack     at ChildProcess.<anonymous> (/Users/jasper/webdesign/larastud.io/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:125:13)
14 verbose stack     at ChildProcess.emit (events.js:213:7)
14 verbose stack     at maybeClose (internal/child_process.js:887:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
15 verbose pkgid @
16 verbose cwd /Users/jasper/webdesign/larastud.io
17 verbose Darwin 16.6.0
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
19 verbose node v8.0.0
20 verbose npm  v5.0.0
21 error code ELIFECYCLE
22 error errno 1
23 error @ dev: `npm run development`
23 error Exit status 1
24 error Failed at the @ dev script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Similar issues mentioned here here an hour before I had it https://laracasts.com/discuss/channels/elixir/npm-run-dev-does-not-work

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sebestenybcommented, Jun 8, 2017

Locking the following package solved the issue for me:

"extract-text-webpack-plugin": "2.1.0"

Tho I use "laravel-mix": "0.5.6"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
ENOENT : no such file or directory, open '. ... or directory, open '/Users/jasper/webdesign/larastud.io/schema/loader.json' at Object.fs.
Read more >
Ask Question - Stack Overflow
ENOENT : no such file or directory, open '. ... data/databases.json') fs.writeFileSync(aPath ,JSON.stringify(companyInfo, null, 2)).
Read more >
JSON Schema loader by id - Opis
The loader is used to produce a validatable schema by parsing the contents of a resolved schema. A schema is parsed only once,...
Read more >
ENOENT: no such file or directory ... but there is - Reddit
The error message I get is: npm ERR! code ENOENT npm ERR! syscall open npm ERR! path C:\Users\filepath\filepath\filepath\filepath/package.json ...
Read more >
npm run dev does not work - Laracasts
_makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/Users/steenrabol/Sites/mytest/schema/loader.json' at ...
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