Description
TypeScript Version: 2.8.1
OS Version: macOS 10.13.3
vscode: 1.22.1
Search Terms: npm link
Code
- A symbolic link (NTFS junction) to a library package in node_modules breaks code's intellisense ability to find the module, even though building from the command line works fine. This makes node dev a pain when developing a lib and consuming package and don't want to go through the publish / install loop
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"declaration": true,
"rootDir": "src",
"outDir": "lib",
"target": "es2015",
"lib": [
"dom",
"es2016"
],
"noImplicitAny": false
},
"include": [
"src/**/*"
]
}
-
Create and compile another package consumer with a file that references the lib with an import {foo} from 'lib'
-
Copy the lib into the consumer's node_modules - as if it had been `npm install'ed
-
Look at the import line in code - all intellisense is good. lib is found
-
Delete node_modules\lib
-
Either manually link by adding a junction or use npm link ..\lib lib is navigable in the code file browser (on left)
-
Look at the import line in code - 'lib' has red squiggle and hover displays '[ts] Cannot find module 'lib'.'
I can supply all files if required, but the lib is just a single file with a single export and consuming code references it. basic stuff.
Expected behavior:
ts-server can find npm link module
Actual behavior:
ts-server can not find npm link module
Playground Link:
Related Issues: microsoft/vscode#25312