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.

docker build error: Cannot find module 'semver'

See original GitHub issue

When attempting to build with the latest hospitalrun-frontend from github, I encounter the following error.

(Docker version 17.03.1-ce, build c6d412e on Ubuntu 14.04)

$ docker build -t hospitalrun-frontend .
...
module.js:471
    throw err;
    ^

Error: Cannot find module 'semver'
    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> (/usr/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
    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)

Looks like it may be related to the following npm issue: https://github.com/npm/npm/issues/15611

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fgiorlandocommented, Apr 6, 2017

OK, I fixed this error by getting rid of the npm update line (as described in this post: https://github.com/npm/npm/issues/15558)

I think the npm update causes a mismatch between the npm version and the cached modules, but I’m not really sure if that’s the cause. So I’d consider this more of a workaround than a fix!

changes to Dockerfile:

- RUN npm install -g npm && npm install -g ember-cli@latest && npm install -g bower
+ #RUN npm install -g npm@latest
+ RUN npm install -g ember-cli@latest
+ RUN npm install -g bower
0reactions
kgrosvenorcommented, Jan 18, 2019

I get this error also, isnt semver a core node module?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker: Error: Cannot find module 'semver' #16807 - GitHub
I've recently found myself running into this exact same problem while attempting to run builds within GitLab CI. It only occurs while using...
Read more >
Npm install cannot find module 'semver' - Stack Overflow
After uninstalling Node, use Command Prompt, navigate to ...\Appdata\roaming\ (use the path from the error message). Try to delete the folder with del...
Read more >
npm install – Cannot find module 'semver' issue - Bala's Blog
I have recently got an error "Cannot find module 'semver'" on my Ubuntu VM when doing npm install. + npm install ... ......
Read more >
Npm can't find module "semver" error in Ubuntu 19.04
I was basically trying to make offline use of FreeCodeCamp. It asked me to run command 'npm ci' from which I started getting...
Read more >
error Cannot find module 'semver' in (npm run dev) command ...
Coding example for the question error Cannot find module 'semver' in (npm run dev) command-Vue.js.
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