npx create-nx-workspace results in Error: Cannot find module 'tslib'
See original GitHub issueCurrent Behavior
npx create-nx-workspace@latest
/ npx create-nx-workspace
fail using both cmd and powershell on Windows 10.
Expected Behavior
It should create a new nx-workspace
Failure Logs
Creating a sandbox with Nx...
new kniffel-app --preset="empty" --interactive=false --collection=@nrwl/workspace
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'tslib'
Require stack:
- C:\Users\mgons\AppData\Local\Temp\tmp-3020ck4Sr83QEb9M\node_modules\.registry.npmjs.org\@nrwl\tao\10.0.12\node_modules\@nrwl\tao\index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\mgons\AppData\Local\Temp\tmp-3020ck4Sr83QEb9M\node_modules\.registry.npmjs.org\@nrwl\tao\10.0.12\node_modules\@nrwl\tao\index.js:5:17)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\mgons\\AppData\\Local\\Temp\\tmp-3020ck4Sr83QEb9M\\node_modules\\.registry.npmjs.org\\@nrwl\\tao\\10.0.12\\node_modules\\@nrwl\\tao\\index.js'
]
}
(node:3020) UnhandledPromiseRejectionWarning: Error: Command failed: "C:\Users\mgons\AppData\Local\Temp\tmp-3020ck4Sr83QEb9M\node_modules\.bin\tao" new kniffel-app --preset="empty" --interactive=false --collection=C:\Users\mgons\AppData\Local\Temp\tmp-3020ck4Sr83QEb9M\node_modules\@nrwl\workspace\collection.json
at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at createApp (C:\Users\mgons\AppData\Roaming\npm-cache\_npx\3020\node_modules\create-nx-workspace\bin\create-nx-workspace.js:367:21)
at C:\Users\mgons\AppData\Roaming\npm-cache\_npx\3020\node_modules\create-nx-workspace\bin\create-nx-workspace.js:85:25
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:3020) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3020) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Environment
Windows 10 NodeJs v. 12.18.3-LTS npm and npx both 6.14.7 powershell v 5.1 build 18362
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Cannot find module "tslib" - angular - Stack Overflow
I was using a typescript module I built in a javascript project. This error occurred ... import { error } from '@angular/compiler/src/util';.
Read more >nrwl-nx/community - Gitter
Hmm, I get an error: Cannot find module 'tslib' ... npx create-nx-workspace@latest temp (selected "empty" and "Angular CLI") cd temp ng add @nrwl/nest...
Read more >cannot find module 'protractor' or its corresponding type ...
ERROR in node_modules/@types/selenium-webdriver/index.d.ts:16:24 - error TS2307: Cannot find module './opera' or its corresponding type declarations.
Read more >Uncaught Error: Cannot find module "tslib" when update to 3.9.2
Hey, I am facing with this issues, please advice. Thanks. Uncaught Error: Cannot find module "tslib" at Object.<anonymous> (compiler.js:1) ...
Read more >This syntax requires an imported helper but module 'tslib ...
To solve the error "This syntax requires an imported helper but module 'tslib' cannot be found", install `tslib` by running `npm install -D...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @mandarini 😃 Thank you very much for your effort to reproduce my issue. Sorry that you can not reproduce it (or in the end it is good because nothing needs to be fixed 😛).
Your tip with reinstalling node did the job! I just re-installed node according to the guide provided in the link and it worked! Now I’m again able to create nx-workspaces.
I re-installed node before as well, but I guess somehow I missed there a part to completely remove it and therefore it didn`t work.
Yey!! I’m so happy it worked and you can use Nx normally now!! 😄