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

deno can not be built under node_modules folder. #1536

Closed
caijw opened this issue Jan 16, 2019 · 1 comment
Closed

deno can not be built under node_modules folder. #1536

caijw opened this issue Jan 16, 2019 · 1 comment

Comments

@caijw
Copy link
Contributor

caijw commented Jan 16, 2019

when using tools/build.py to build deno, if deno is under a node_modules folder, it can not work.

/Users/jingweicai/Documents/code/node_modules/deno/tools/ts_library_builder/main.ts:1
(function (exports, require, module, __filename, __dirname) { import * as path from "path";
                                                                     ^

SyntaxError: Unexpected token *
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/jingweicai/Documents/code/node_modules/deno/third_party/node_modules/ts-node/src/index.ts:431:14)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
[322/540] ACTION //build_extra/rust:unicode_segmentation_rustc(//build/toolchain/mac:clang_x64)
ninja: build stopped: subcommand failed.

And i figure out it is because:
ts-node won't compile code under node_modules folder.
see the ts-node issue: TypeStrong/ts-node#505 (comment)
When generating the compiled code gen/lib/lib.deno_runtime.d.ts, this error hanppens.
I open this issue to remind others not to put deno under any node_modules folder.

@caijw
Copy link
Contributor Author

caijw commented Jan 21, 2019

#1555

Adding a ts-node cli option can fix this.

@caijw caijw closed this as completed Jan 21, 2019
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

1 participant