Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn install result in missing modules but using npm install everything is fine #5115

Closed
Skaronator opened this issue Dec 20, 2017 · 2 comments
Assignees
Labels

Comments

@Skaronator
Copy link

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

What is the current behavior?

My yarn is broke for what ever reason. Using yarn install always result in missing modules. Everything is fine when using npm install for install and then using yarn start.

This issue is only present on this PC. My home PC and also my Surface work fine with yarn! I tried to uninstall yarn, npm, node and reinstall everything but didn't fix this issue.

If the current behavior is a bug, please provide the steps to reproduce.
I use create-react-app since its simple to test. It use yarn automatically if its installed.

C:\Users\Skaronator\Documents\GitHub>create-react-app my-app

Creating a new React app in C:\Users\Skaronator\Documents\GitHub\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.2: The platform "win32" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.1.3: The platform "win32" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 882 new dependencies.
Done in 14.04s.

Success! Created my-app at C:\Users\Skaronator\Documents\GitHub\my-app
...
C:\Users\Skaronator\Documents\GitHub>cd my-app
C:\Users\Skaronator\Documents\GitHub\my-app>yarn start
Failed to compile.

./src/index.js
Module build failed: Error: Cannot find module 'doctrine'
Referenced from:          (yes this is EOL)

^As you can see I get missing module errors. Now I'll purge node_modules and use npm for the install.

C:\Users\Skaronator\Documents\GitHub\my-app>rm -rf node_modules

C:\Users\Skaronator\Documents\GitHub\my-app>npm install

> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\Skaronator\Documents\GitHub\my-app\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1151 packages in 27.099s

^it has added 1151 packages and yarn only 882. (???)

C:\Users\Skaronator\Documents\GitHub\my-app>yarn start
yarn run v1.3.2
$ react-scripts start
Compiled successfully!

You can now view my-app in the browser.

  Local:            http://localhost:3000/
  On Your Network:  http://192.168.10.3:3000/

Note that the development build is not optimized.
To create a production build, use yarn build.

Please mention your node.js, yarn and operating system version.
yarn: 1.3.2
node: v8.9.3
npm: 5.6.0
Windows 10

I didn't find anything on google, something is wrong with this PC and I can't find out what.

@ghost ghost assigned BYK Dec 20, 2017
@ghost ghost added the triaged label Dec 20, 2017
@Skaronator
Copy link
Author

Skaronator commented Dec 20, 2017

Damn I should have done this before. Deleting npm, npm-cache and the Yarn folder in AppData actually fix this issue.

It would be good if the Yarn folder in AppData would be deleted when you uninstall Yarn.

@shrutik27
Copy link

throw new Error('Cannot log to file without filename or stream.');
^

Error: Cannot log to file without filename or stream.
at new File (D:\justprescribe.tech\node_modules\winston\lib\winston\transports\file.js:73:13)
at Object. (D:\justprescribe.tech\utils\logger.js:38:27)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (D:\justprescribe.tech\app.js:12:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
[nodemon] app crashed - waiting for file changes before starting...

can anyone help with this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants