Yarn: Error message: Cannot find module 'lodash/cloneDeep'

Created on 2 Mar 2018  路  6Comments  路  Source: yarnpkg/yarn

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

What is the current behavior?
I have an app created with "react-create-start", with the following dependencies:
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.0",
"sjcl": "^1.0.7",
"start": "^5.1.0"
},

The app runs well on windows 10 machines, but when I run it with "yarn start" on a Windows 8 machine, I get the following error:
"./src/index.js
Module build failed: Error: Cannot find module 'lodash/cloneDeep'"

The error does not occur, when I use npm on this machine ("npm install, "npm start").

I tried to update the dependencies to the following. but the error still occurs:

"dependencies": {
"lodash.clonedeep": "^4.5.0",
"lodash.omit": "^4.5.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.0",
"sjcl": "^1.0.7",
"start": "^5.1.0"
},

What is the expected behavior?
The same behavior as on Windows 10 machines or running with npm: The app should start without error message.

Please mention your node.js, yarn and operating system version.
yarn --version: 1.5.1
node --version: v8.9.4 (64 bit)
OS: Windows 8.1. pro, 64 bit

triaged

Most helpful comment

Stumbled upon the same issue. Deleting ~/.cache/yarn (on macos) helped.

All 6 comments

Same issue here

Same issue here, if I install with npm i everything works fine, but if I run yarn on the my Ionic project it doesn't start and tells that it can't find the loadsh module.
Yarn 1.5.1, Node 8.10.0 on macOS High Sierra.

Confirm issue happend with Yarn 1.5.1,

Stumbled upon the same issue. Deleting ~/.cache/yarn (on macos) helped.

Is this issue already solved? I am using 1.17.3, and there is no problem at all. But, my production is using v1.5.2 and the problem still exists. Can someone confirm this?

Stumbled upon the same issue. Deleting ~/.cache/yarn (on macos) helped.

Drive-by comment in 2019 to highlight that this worked for me too (Ubuntu 14). I missed this when googling the first time around, so worth highlighting.

Was this page helpful?
0 / 5 - 0 ratings