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.

Error while npm Start

See original GitHub issue

Hi everyone, I’ve tried to setup mern-starter using NVM, tried using : [ + ] Node v6.3.1 and npm 3.10.3 (Latest) [ + ] Node v4.4.7 and npm 2.15.8 (LTS) on Ubuntu 16.04.1 (LTS).

I did a clean install by cloning the repo. On running “npm start” I get the following error. Any thoughts or workarounds would be appreciated.

module.js:327
    throw err;
    ^

Error: Cannot find module '/media/manpreet/Media'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3
/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/lib/transformation/file/index.js:591
      throw err;
      ^

Error: /media/manpreet/Media and Files/work projects/mern-starter/client/modules/App/App.js: Command failed: node /media/manpreet/Media and Files/work projects/mern-starter/node_modules/webpack/bin/webpack.js /media/manpreet/Media and Files/work projects/mern-starter/client/modules/App/App.css /tmp/.webpack.res.1469537186753_457444.js --config ./webpack.config.babel.js --bail
module.js:327
    throw err;
    ^

Error: Cannot find module '/media/manpreet/Media'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

    at checkExecSyncError (child_process.js:464:13)
    at execSync (child_process.js:504:13)
    at exports.default (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-plugin-webpack-loaders/lib/runWebPackSync.js:39:51)
    at PluginPass.CallExpression (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-plugin-webpack-loaders/lib/plugin.js:101:60)
    at newFn (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:301:19)
    at NodePath._call (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:106:12)
    at TraversalContext.visitQueue (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:167:16)
    at TraversalContext.visitSingle (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:118:19)
    at TraversalContext.visit (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:211:19)
    at Function.traverse.node (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/index.js:161:17)
    at NodePath.visit (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:116:19)
    at TraversalContext.visitQueue (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:167:16)
    at TraversalContext.visitMultiple (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:113:17)
    at TraversalContext.visit (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:209:19)
    at Function.traverse.node (/media/manpreet/Media and Files/work projects/mern-starter/node_modules/babel-core/node_modules/babel-traverse/lib/index.js:161:17)
[nodemon] app crashed - waiting for file changes before starting...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Werbelowcommented, Nov 27, 2016

Figured it out, it was due to my parent folder having a space in it’s name. Once I removed the space, it worked.

Hopefully, this helps out.

1reaction
kunzhang1110commented, Oct 10, 2018

I twisted the runWebPackSync.js file a bit by allowing spaces on windows path, and it worked fine.

var pathString = [webPackPath, path, outPath, configPath].map(x => {return '\"' + x + '\"'});	//allow white spaces in path for windows

var webPackStdOut = (0, _child_process.execSync)(['node', pathString[0], pathString[1], pathString[2], '--config', pathString[3], '--bail'].join(' ')); // for windows support
Read more comments on GitHub >

github_iconTop Results From Across the Web

npm start giving error in node.js - Stack Overflow
The error suggests that the ./bin/www directory is not found. Paths specified with a dot are relative to the current directory, ...
Read more >
npm ERR! Missing script: "start" [Solved] | bobbyhadz
To solve the npm ERR! Missing script: "start" error, make sure to add a start command to the scripts object in your package.json...
Read more >
How to fix npm start command not working - Nathan Sebhastian
How to fix npm start command not working · Check if the package.json file exists · Check if the start script is defined...
Read more >
npm err! missing script: start Solution - Career Karma
If you type npm start and get the npm err! missing script: start error, there must be a missing line in the script...
Read more >
Common errors | npm Docs
Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later. · This can be caused...
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