Cannot install Nx

See original GitHub issue

Expected Behavior

I expect that when I enter the command npm init nx-workspace project-name-here the command will create a folder, put a package.json in it and create a blank nx workspace.

I am on a Windows 10 machine, and I’ve used Nx before, I don’t understand why it isn’t working.

Current Behavior

It errors out, so I tried starting off with an Angular workspace and adding the nx to it, and that failed as well.

Failure Information (for bugs)

npm init nx-workspace vorakor-samples-workspace Error: EPERM: operation not permitted, mkdir ‘C:\Users<username>’ TypeError: Cannot read property ‘loaded’ of undefined at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27) at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:77:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98

TypeError: Cannot read property ‘loaded’ of undefined at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27) at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:496:27) Install for create-nx-workspace@latest failed with code 7 PS C:\Users<username>\Development> npm config edit
PS C:\Users<username>\Development> npm init nx-workspace vorakor-samples-workspace Error: EPERM: operation not permitted, mkdir ‘C:\Users<username>’ TypeError: Cannot read property ‘loaded’ of undefined at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27) at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:77:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98 ^

TypeError: Cannot read property ‘loaded’ of undefined at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27) at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:496:27) Install for create-nx-workspace@latest failed with code 7 PS C:\Users<username>\Development> npm init nx-workspace vorakor-samples-workspace Error: EPERM: operation not permitted, mkdir ‘C:\Users<username>’ TypeError: Cannot read property ‘loaded’ of undefined at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27) at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:77:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98 ^ at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27) at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:496:27) Install for create-nx-workspace@latest failed with code 7 PS C:\Users<username>\Development> whoami 376l<username> PS C:\Users<username>\Development> npm config edit PS C:\Users<username>\Development> ng new vorakor-samples-workspace --create-application=false CREATE vorakor-samples-workspace/angular.json (135 bytes) CREATE vorakor-samples-workspace/package.json (1261 bytes) CREATE vorakor-samples-workspace/README.md (1041 bytes) CREATE vorakor-samples-workspace/tsconfig.json (543 bytes) CREATE vorakor-samples-workspace/tslint.json (1761 bytes) CREATE vorakor-samples-workspace/.editorconfig (246 bytes) CREATE vorakor-samples-workspace/.gitignore (631 bytes) npm WARN deprecated core-js@2.6.11: core-js@❤️ is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

core-js@2.6.11 postinstall C:\Users<username>\Development\vorakor-samples-workspace\node_modules\core-js node -e “try{require(‘./postinstall’)}catch(e){}”

@angular/cli@8.3.22 postinstall C:\Users<username>\Development\vorakor-samples-workspace\node_modules@angular\cli node ./bin/postinstall/script.js

npm WARN karma-jasmine-html-reporter@1.5.1 requires a peer of jasmine-core@>=3.5 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

added 697 packages from 851 contributors and audited 8170 packages in 21.884s found 0 vulnerabilities

warning: LF will be replaced by CRLF in .editorconfig. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in .gitignore. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in README.md. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in angular.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in package.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tsconfig.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tslint.json. The file will have its original line endings in your working directory Successfully initialized git. PS C:\Users<username>\Development> cd .\vorakor-samples-workspace
PS C:\Users<username>\Development\vorakor-samples-workspace> ls

Directory: C:\Users\<username>\Development\vorakor-samples-workspace

Mode LastWriteTime Length Name


d----- 1/11/2020 22:05 node_modules -a---- 1/11/2020 22:04 246 .editorconfig -a---- 1/11/2020 22:04 135 angular.json -a---- 1/11/2020 22:05 239584 package-lock.json -a---- 1/11/2020 22:04 1261 package.json -a---- 1/11/2020 22:04 1041 README.md -a---- 1/11/2020 22:04 543 tsconfig.json -a---- 1/11/2020 22:04 1761 tslint.json

PS C:\Users<username>\Development\vorakor-samples-workspace> npm init nx-workspace npm ERR! code ENOLOCAL

npm ERR! A complete log of this run can be found in: Install for create-nx-workspace@latest failed with code 1 PS C:\Users<username>\Development\vorakor-samples-workspace> ng add @nrwl/workspace Installing packages for tooling via npm. Installed packages for tooling via npm. Cannot read property ‘replace’ of undefined PS C:\Users<username>\Development\vorakor-samples-workspace> ng add @nrwl/workspace Skipping installation: Package already installed Cannot read property ‘replace’ of undefined PS C:\Users<username>\Development\vorakor-samples-workspace> ng add @nrwl/workspace Installing packages for tooling via npm. Installed packages for tooling via npm. An unhandled exception occurred: Cannot find module ‘typescript’ See “C:\Users<username>\AppData\Local\Temp\ng-3rJ4Ja\angular-errors.log” for further details.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Changed directory to be outside of existing projects but still in desired folder where I want to create a new folder to contain workspace.
  2. Entered command.
  3. Upon failing multiple times, I used ng new project-workspace-name-here --create-application=false to create a new blank Angular workspace.
  4. Upon creation of new workspace, changed directories into the workspace.
  5. Attempted to run npm init nx-workspace again.
  6. Upon failure again, attempted to run ng add @nrwl/workspace
  7. Upon yet another failure, submitted ticket.

Context

Using latest version of Nx, NPM version 6.9.0, node version 10.16.3, Windows 10 OS, Visual Studio Code.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

5reactions
bsultonovcommented, Jun 7, 2020

Try to replace your npm-cache folder to another path by running npm config set cache C:\tmp\nodejs\npm-cache --global

0reactions
nhhockeyplayercommented, Jul 2, 2021

I try to build it individually with nx build shared-assets

this is what comes

meanstack02@admin energy % nx build shared-assets
internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module '@nrwl/workspace/src/utilities/perf-logging'
Require stack:
- /Users/meanstack02/node_modules/@nrwl/cli/lib/init-local.js
- /Users/meanstack02/node_modules/@nrwl/cli/bin/nx.js
- /Users/meanstack02/.config/yarn/global/node_modules/@nrwl/cli/bin/nx.js
- /Users/meanstack02/.config/yarn/global/node_modules/nx/bin/nx.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (/Users/meanstack02/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.initLocal (/Users/meanstack02/node_modules/@nrwl/cli/lib/init-local.js:17:5)
    at Object.<anonymous> (/Users/meanstack02/node_modules/@nrwl/cli/bin/nx.js:43:18)
    at Module._compile (/Users/meanstack02/.config/yarn/global/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/meanstack02/node_modules/@nrwl/cli/lib/init-local.js',
    '/Users/meanstack02/node_modules/@nrwl/cli/bin/nx.js',
    '/Users/meanstack02/.config/yarn/global/node_modules/@nrwl/cli/bin/nx.js',
    '/Users/meanstack02/.config/yarn/global/node_modules/nx/bin/nx.js'
  ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

nx: command not found error [Solved] | bobbyhadz
If the "nx: command not found" error is not resolved, try restarting your terminal. If that doesn't help, run the following command: shell....
Read more >
NX ERROR - Nx failed to install dependencies - Stack Overflow
NX ERROR - Nx failed to install dependencies ; Same problem here, it seems to be failing when building the @parcel/watcher package. (M1...
Read more >
Cannot install or uninstall Nx Client after botched update ...
1. Go to MyNetworkOptix to download the latest installer of the Nx Witness. 2. Follow this support ARTICLE to clean uninstall the Nx...
Read more >
Hi, I am a new user of NX and have encountered some an ...
If that doesn't work, browse to the folder where you installed NX Student Edition, open the UGII folder and double click ugraf.exe.
Read more >
Windows 10 does not install because NX support does not ...
If you cannot find any, try upgrading your BiOS version. That might solve your issue. NOTE: Be aware that changing BiOS settings might...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found