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

Does not correctly install tslint under devDependencies #1825

Closed
carlansley opened this issue Nov 14, 2016 · 5 comments
Closed

Does not correctly install tslint under devDependencies #1825

carlansley opened this issue Nov 14, 2016 · 5 comments

Comments

@carlansley
Copy link

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

What is the current behavior?
If the tslint package is contained within devDependencies, Yarn does not install files under node_modules/tslint/lib/test which tslint requires to operate.

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

With a package.json like this:

{
  "name": "dummy",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "tslint": "^3.15.1",
    "typescript": "^2.0.9"
  }
}

Using yarn to install produces the following result:

$ yarn install
info No lockfile found.
[1/5] 🔍  Resolving packages...
[2/5] 🚚  Fetching packages...
[3/5] 🔗  Linking dependencies...
[4/5] 📃  Building fresh packages...
[5/5] ♻️  Cleaning modules...
success Saved lockfile.
✨  Done in 0.90s.

$ ./node_modules/.bin/tslint --version
module.js:471
    throw err;
    ^

Error: Cannot find module './test/parse'
    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/carl/Development/dummy/node_modules/tslint/lib/test.js:10:13)
    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)

tslint is non-functional.

What is the expected behavior?

NPM, with the same package.json, behaves as follows:

$ npm install
dummy@1.0.0 /Users/carl/Development/dummy
├─┬ tslint@3.15.1 
│ ├── colors@1.1.2 
│ ├── diff@2.2.3 
│ ├─┬ findup-sync@0.3.0 
│ │ └── glob@5.0.15 
│ ├─┬ glob@7.1.1 
│ │ ├── fs.realpath@1.0.0 
│ │ ├─┬ inflight@1.0.6 
│ │ │ └── wrappy@1.0.2 
│ │ ├── inherits@2.0.3 
│ │ ├─┬ minimatch@3.0.3 
│ │ │ └─┬ brace-expansion@1.1.6 
│ │ │   ├── balanced-match@0.4.2 
│ │ │   └── concat-map@0.0.1 
│ │ ├── once@1.4.0 
│ │ └── path-is-absolute@1.0.1 
│ ├─┬ optimist@0.6.1 
│ │ ├── minimist@0.0.10 
│ │ └── wordwrap@0.0.3 
│ ├── resolve@1.1.7 
│ └─┬ underscore.string@3.3.4 
│   ├── sprintf-js@1.0.3 
│   └── util-deprecate@1.0.2 
└── typescript@2.0.9 

npm WARN dummy@1.0.0 No description
npm WARN dummy@1.0.0 No repository field.

$ ./node_modules/.bin/tslint --version
3.15.1

tslint is ok.

Please mention your node.js, yarn and operating system version.

node v6.9.0
yarn v0.17.0
macOS 10.12.1

@carlansley carlansley changed the title Yarn does not correctly install tslint as a devDependency Does not correctly install tslint under devDependencies Nov 14, 2016
@spoptchev
Copy link

I can confirm this issue.

node v7.1.0
yarn v0.16.1
macOS 10.11.5

@bestander
Copy link
Member

Can't reproduce it on master and node 6.2.1

@zerok
Copy link

zerok commented Nov 17, 2016

Cannot reproduce on...

yarn: 0.17.3
node: 4.6.0, 6.9.1
macOS 10.12.1

@jthomaschewski
Copy link

jthomaschewski commented Nov 18, 2016

I used to have this bug too:

yarn 0.17.0
node v7.1.0
Arch Linux x64

I can't reproduce it now using yarn 0.17.3
So it might have been fixed or it's caused by side effects which have to be figured out.

@carlansley
Copy link
Author

I think this can be closed. What I found is if you have a .yarnclean file lying around, yarn install will wipe out the test directory under tslint/lib.

Maybe the clean command should be removed from yarn, or renamed. Not exactly sure what happened, I must've tried to do a yarn run clean at some point and missed the run part. Looks like others have fallen into the same trap.

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

No branches or pull requests

6 participants