-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
Ts-node fails when using symlinks #396
Comments
I've similar issue when using a The bin file: #!/usr/bin/env node
"use strict";
const config = require("../tsconfig.json");
require("ts-node").register(config);
require("../cli/index"); So this is a bin file, a symlink to that file is created in
When executing the bin inside the project root everything works fine, but when I want to execute that anywhere else it looks like there are no
|
Same problem. Problem
__shared/ShareClass.ts import XXX from 'some-node-modules';
... backend/index.ts import XXX from './shared/ShareClass';
It will throw error:
Expect Demo
|
Hi guys, I just find a solution to resolve this.
@blakeembrey The problem is mainly because in TypeScript preserveSymlinks is true by default, while it is false in NodeJS by default. |
@blakeembrey Maybe it's better to auto set |
|
|
@kirillgroshkov I know is late, but setting environment var NODE_PRESERVE_SYMLINKS to 1 should work (only node 7.1 or newer). |
this worked for me. I have the code (./src) in a place and a workspace in other location (which contains node_modules), ie:
///////////////////////
running the script with --preserve-symlinks fix the missing module error. (chai in my case) |
Symlink issues are likely fixed in 9.0.0 by #970 |
this setting did the job while using |
Hi,
I'm reporting here an issue I described here #391 (comment).
To reproduce the problem you can just use the frameworks we are developing.
git clone -b housekeeping [email protected]:tierratelematics/prettygoat.git
git clone -b 4.0.0-alignment [email protected]:tierratelematics/prettygoat-cassandra-store.git
You can download the sources from there and install deps on both projects. Then go to prettygoat-cassandra-store and npm link prettygoat. You can see that both tsc and ts-node are failing. Link also rxjs (the one in the prettygoat's node_modules) to the cassandra module and tsc now it's working.
The commands I'm using to test tsc/ts-node:
tsc --outDir build
ts-node scripts/prettygoat-cassandra-store.ts
The text was updated successfully, but these errors were encountered: