Cannot install Nx
See original GitHub issueExpected 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.
- Changed directory to be outside of existing projects but still in desired folder where I want to create a new folder to contain workspace.
- Entered command.
- Upon failing multiple times, I used
ng new project-workspace-name-here --create-application=falseto create a new blank Angular workspace. - Upon creation of new workspace, changed directories into the workspace.
- Attempted to run
npm init nx-workspaceagain. - Upon failure again, attempted to run
ng add @nrwl/workspace - 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:
- Created 4 years ago
- Reactions:1
- Comments:12
Top Related StackOverflow Question
Try to replace your npm-cache folder to another path by running
npm config set cache C:\tmp\nodejs\npm-cache --globalI try to build it individually with nx build shared-assets
this is what comes