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

Typescript typings not found #404

Closed
aecz opened this issue Oct 6, 2016 · 7 comments
Closed

Typescript typings not found #404

aecz opened this issue Oct 6, 2016 · 7 comments

Comments

@aecz
Copy link
Contributor

aecz commented Oct 6, 2016

pnpm v0.39.0
node v6.5.0
OS Windows 7

Code to reproduce the issue:

mkdir typings-test
cd typings-test
pnpm install [email protected] mocha @types/mocha
mkdir test
cd ..

Create a test.ts file with the following content:

describe('Test', () => {    
    describe('run', () => {
        it('should run', () => {
            console.log('i run');
        });
    });
});

Then run:

node_modules/.bin/tsc test/test.ts
node_modules/.bin/mocha

Expected behavior:

  • test.ts get compiled into test.js
  • mocha runs and passed

Actual behavior:

  • test.ts fails compilation with error 'Cannot find name describe'
  • mocha does not find any test files (look for *.js)

I suggest we could copy the @types packages into node_modules instead of linking them. Seems to solve the issue as commented here: #394 (comment)

@zkochan
Copy link
Member

zkochan commented Oct 6, 2016

I really hope this will be fixed on the TypeScript side... It would look really weird to have such hacks in the pnpm codebase

@zkochan
Copy link
Member

zkochan commented Oct 6, 2016

Maybe we can fall back to npm for some "blacklist" of popular packages...

@aecz
Copy link
Contributor Author

aecz commented Oct 6, 2016

What about a flag --copy-typings or --no-link-typings ? Does not affect pnpm users and if Typescript fixes it then no need to set flag :)

@zkochan
Copy link
Member

zkochan commented Oct 6, 2016

I understand, I am talking about the implementation. Seems like it will be the same that npm does, so we can just run npm install inside pnpm for those dependencies

@zkochan
Copy link
Member

zkochan commented Oct 22, 2016

Maybe hard links would solve this issue.

@zkochan
Copy link
Member

zkochan commented Nov 21, 2016

This is going to be fixed in TypeScript 2.1.0. If you use typescript@next, it will work already

@zkochan
Copy link
Member

zkochan commented Dec 9, 2016

I am closing this because the latest TypeScript is 2.1.0 now and it has all the symlink issues solved. So this will work with the latest TypeScript

@zkochan zkochan closed this as completed Dec 9, 2016
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

2 participants