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: Cannot find module '../package.json'

See original GitHub issue

webpack

module.js:471 throw err; ^

Error: Cannot find module ‘…/package.json’ 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> (/Users/vinyuan/code/uculture/webpack-demo3/node_modules/.bin/webpack:17:22) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

npm ERR! Darwin 16.5.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “build” npm ERR! node v6.11.2 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! webpack-demo2@1.0.0 build: webpack npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the webpack-demo2@1.0.0 build script ‘webpack’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the webpack-demo2 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs webpack-demo2 npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls webpack-demo2 npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/vinyuan/code/uculture/webpack-demo3/npm-debug.log

Do you want to request a feature or report a bug?

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

Issue Analytics

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

github_iconTop GitHub Comments

105reactions
davidtinkercommented, Sep 10, 2018

@mygovernance I had the same error after moving a project to a different directory. I fixed it by nuking my node_modules and redoing ‘npm install’.

46reactions
xxxsfcommented, Jan 10, 2019
rm -rf node_modules
npm install
Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot find module [Node npm Error Solved] - freeCodeCamp
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 >
16 - Stack Overflow
Vue Cli: Cannot find module '../package.json' error after npm install · 5. I experienced the same problem after moving the folder to a...
Read more >
Error: Cannot find module '/package.json' · Issue #1353 - GitHub
Dashboard app unable to start, displaying error message. After starting the Cube.js development server $ npm run dev Navigate to "Dashboard ...
Read more >
How to resolve "Cannot find module" error in Node - Sabe.io
The issue is that Node is unable to find the module that you are trying to import into your Node application. The most...
Read more >
Error: Cannot find module in JavaScript [SOLVED]
Error : Cannot find module 'package-name' is a popular module error message that you might face when working with Node and its packages...
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