yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Error message: Cannot find module 'lodash/cloneDeep' #5439

Open MSchusterDcb opened 6 years ago

MSchusterDcb commented 6 years ago

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

ngohungphuc commented 6 years ago

Same issue here

tuliomarchetto commented 6 years ago

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.

ngohungphuc commented 6 years ago

Confirm issue happend with Yarn 1.5.1,

jerguslejko commented 6 years ago

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

ramjak commented 5 years ago

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?

jplindstrom commented 5 years ago

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.