I am trying to install angular-cli using latest versions of npm(5.3.0) and node (v8.2.1) on Windows7 64 bit environment. npm and node are working as expected.
But when I try to install angular-cli using the command:
npm install -g #angular/cli
It is failing after copying all the required files to the appdata/Raoming/npm folder. Below is the error stack trace:
11902 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11903 verbose cwd C:\Windows\system32
11904 verbose Windows_NT 6.1.7601
11905 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "#angular/cli"
11906 verbose node v8.2.1
11907 verbose npm v5.3.0
11908 error path C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090
11909 error code EPERM
11910 error errno -4048
11911 error syscall rename
11912 error Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error { Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error cause:
11912 error { Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error errno: -4048,
11912 error code: 'EPERM',
11912 error syscall: 'rename',
11912 error path: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\#angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090',
11912 error dest: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\#angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json' },
11912 error stack: 'Error: EPERM: operation not permitted, rename \'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\#angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090\' -> \'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\#angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json\'',
11912 error errno: -4048,
11912 error code: 'EPERM',
11912 error syscall: 'rename',
11912 error path: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\#angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090',
11912 error dest: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\#angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json',
11912 error parent: 'webpack-dev-server' }
11913 error Please try running this command again as root/Administrator.
11914 verbose exit [ -4048, true ]
Note: I was successful in installing this on my MAC OS. I tried uninstalling npm and node, reinstalled again and tried again, but did not work. I have administrator access on the machine that I am working on. Tried running the command prompt as Administrator as well.
You might need to use Node6 for 32-bit support.
Related
I have a powershell build script that runs npm install at some point.
I looked into the issue around the net, but I couldn't find anything helpful. I saw that somebody recommended putting an exception in Windows Defender for the jenkins folder because it was locking files. I did that, still no luck.
I don't think there are any locks on my part from the script, I'm just running npm install.
The strange thing is that this doesn't always happen, sometimes it works, sometimes it doesn't.
26610 verbose stack Error: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'
26612 verbose Windows_NT 10.0.18363
26613 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
26614 verbose node v12.18.2
26615 verbose npm v6.14.5
26616 error code EPERM
26617 error syscall unlink
26618 error path C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js
26619 error errno -4048
26620 error Error: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'
26620 error [OperationalError: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'] {
26620 error cause: [Error: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'] {
26620 error errno: -4048,
26620 error code: 'EPERM',
26620 error syscall: 'unlink',
26620 error path: 'C:\\Jenkins\\workspace\\...\\node_modules\\.staging\\highcharts-705cfa89\\highcharts.src.js'
26620 error },
26620 error errno: -4048,
26620 error code: 'EPERM',
26620 error syscall: 'unlink',
26620 error path: 'C:\\Jenkins\\workspace\\...\\node_modules\\.staging\\highcharts-705cfa89\\highcharts.src.js',
26620 error parent: 'react'
26620 error }
26621 error The operation was rejected by your operating system.
26621 error It's possible that the file was already in use (by a text editor or antivirus),
26621 error or that you lack permissions to access it.
26621 error
26621 error If you believe this might be a permissions issue, please double-check the
26621 error permissions of the file and its containing directories, or try running
26621 error the command again as root/Administrator.
26622 verbose exit [ -4048, true ]
Try yarn install instead of npm install
For anyone who runs into this issue
The package-lock.json was the issue. We have a proget feed for npm packages that we use, but the package-lock.json had the registry set to the default npm registry. This is what caused the issues.
The solution is either to delete the package-lock.json file or to commit it after you run npm install with the correct registry.
Is Angular a serious framework anymore if an error or bug seems so rampant and can persist for so long without any documented way of resolving it?
....
24695 silly saveTree | +-- builtin-modules#1.1.1
24695 silly saveTree | +-- semver#5.7.1
24695 silly saveTree | `-- tsutils#2.29.0
24695 silly saveTree +-- typescript#3.5.3
24695 silly saveTree `-- zone.js#0.9.1
24696 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\karma\node_modules\fsevents):
24697 warn enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\wamp64\www\SALES-IMS\node_modules\.staging\fsevents-25de8bdf\node_modules\abbrev' -> 'D:\wamp64\www\SALES-IMS\node_modules\.staging\abbrev-5ccfe549'
24698 verbose enoent SKIPPING OPTIONAL DEPENDENCY: This is related to npm not being able to find a file.
24698 verbose enoent SKIPPING OPTIONAL DEPENDENCY:
24699 verbose stack Error: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'
24700 verbose cwd D:\wamp64\www\SALES-IMS
24701 verbose Windows_NT 10.0.17134
24702 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
24703 verbose node v12.11.1
24704 verbose npm v6.11.3
24705 error code EPERM
24706 error syscall unlink
24707 error path D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js
24708 error errno -4048
24709 error Error: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'
24709 error [OperationalError: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'] {
24709 error cause: [Error: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'] {
24709 error errno: -4048,
24709 error code: 'EPERM',
24709 error syscall: 'unlink',
24709 error path: 'D:\\wamp64\\www\\SALES-IMS\\node_modules\\.staging\\typescript-4e9060a8\\lib\\tsserver.js'
24709 error },
24709 error stack: "Error: EPERM: operation not permitted, unlink 'D:\\wamp64\\www\\SALES-IMS\\node_modules\\.staging\\typescript-4e9060a8\\lib\\tsserver.js'",
24709 error errno: -4048,
24709 error code: 'EPERM',
24709 error syscall: 'unlink',
24709 error path: 'D:\\wamp64\\www\\SALES-IMS\\node_modules\\.staging\\typescript-4e9060a8\\lib\\tsserver.js',
24709 error parent: 'SALES-IMS'
24709 error }
24710 error The operation was rejected by your operating system.
24710 error It's possible that the file was already in use (by a text editor or antivirus),
24710 error or that you lack permissions to access it.
24710 error
24710 error If you believe this might be a permissions issue, please double-check the
24710 error permissions of the file and its containing directories, or try running
24710 error the command again as root/Administrator.
24711 verbose exit [ -4048, true ]
I have tried the following to no avail.
I have disabled the antivirus and
severally repeated the install,
reboot my machine,
ensured VS Studio Code is closed...,
run npm cache clean, then npm cache clean --force, manually deleted both npm
cache and npm folders under the %APPDATA% path and then reinstalled
angular with npm install -g #angular/cli
all to the same EPERM error,... different files but same errno -4048.
I have enough GB's of free space on hard drive, there's also nothing peculiar about permissions. Am an admin in the Windows 10 laptop. Every CMD instruction am running as administrator. It has been weeks on end, tried all sorts of suggestions online... and no solution in sight.
Finally, is there a way out of this? Or do I just abandon Angular for being a unreliable unusable framework?
I have finally been able to figure out a solution. Which is, to install the failing packages, each at a time using npm install package --force.
For instance, in my case it was npm install -g #angular/core#~8.2.13 --force and npm install -g typescript#~3.5.3 --force.
After which I then repeat ng new project-name command as before. It now works successfully.
Nothing else that has been suggested worked, not in my case.
Much thanks!
This doesn't have anything to do with Angular itself, but with your NodeJS installation and npm. The first step would be to ensure there is no real permission issue.
I Was facing the same and similar errors running npm install for an existing Angular 7 project for several weeks now. Finally decided to switch from npm to yarn and everything worked fine since then. Switching to yarn as package manager did the trick for me after inconsistent and random errors with npm annoyed me for several weeks.
Maybe downgrading to an older npm version (~5.3.0) could also fix that issue.
I'm trying to run npm install on my project but its showing EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging
I don't have root administrative access. I'am using as local user in my system and my system is windows 10
node v10.16.3
npm v6.11.3
Can any one please help me to resolve this issue. I'am requesting you guys please.
3235 error code EPERM
3236 error syscall mkdir
3237 error path C:\Program Files\nodejs\node_modules\.staging
3238 error errno -4048
3239 error Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
3239 error { [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging']
3239 error cause:
3239 error { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
3239 error errno: -4048,
3239 error code: 'EPERM',
3239 error syscall: 'mkdir',
3239 error path: 'C:\\Program Files\\nodejs\\node_modules\\.staging' },
3239 error stack:
3239 error 'Error: EPERM: operation not permitted, mkdir \'C:\\Program Files\\nodejs\\node_modules\\.staging\'',
3239 error errno: -4048,
3239 error code: 'EPERM',
3239 error syscall: 'mkdir',
3239 error path: 'C:\\Program Files\\nodejs\\node_modules\\.staging',
3239 error parent: 'nodemon' }
3240 error The operation was rejected by your operating system.
3240 error It's possible that the file was already in use (by a text editor or antivirus),
3240 error or that you lack permissions to access it.
3240 error
3240 error If you believe this might be a permissions issue, please double-check the
3240 error permissions of the file and its containing directories, or try running
3240 error the command again as root/Administrator.
3241 verbose exit [ -4048, true ]
Try clearing the cache:
npm cache clean --force
Or
npm uninstall npm -g
npm install npm -g
Or
npm set prefix 'C:\Users\User\AppData\Roaming\npm'
The last one worked for me
run these commands:
npm uninstall -g create-react-app
npm install -g create-react-app
that's will upgrade your npx, then run
npx create-react-app my-app
Open your command line (CMD) as an admin.
Navigate to your project directory.
Install the package globally e.g nodemon or any other npm package.
This worked for me.
on windows 10 👍
From Start Menu : type "CMD" then "run as administrator"
then continue using "Node Commands"
Delete 'C:\Users\User\AppData\Roaming\npm' folder or just rename it (like to 'npm_') to be on safe side, and then run command:
npm install
this will create 'C:\Users\User\AppData\Roaming\npm' folder again.
This worked for me.
Run
npm cache clear
npm install npm -g
If you run the command npm cache clear get error, it means you don't have npm installed yet, just run the following command: npm install npm -g
Then close command prompt or visual studio code and run it again to take effect
Today we ran into the same problem. It turned out that there was a environment variable set:
NPM_CONFIG_PREFIX=C:\Program Files\Nodejs
Removing this environment variable fixed the problem fo us.
I solve this issue...
Firstly you change your drive
c drive change make new drive D and then run your command
D:\nodejs> vue create hello-world
this is what worked for me
I have upgraded my version of Nodejs and npm, and after doing this I'm receiving the following error when running my nodejs application:
I saw a tons of post regarding this issue, and I tried everything exposed there like these ones:
1) Uncaught Error: Module did not self-register
2) Error: Module did not self-register" running first example of main github page (Node 0.11.13)
By executing a "npm rebuid" I see the following output in console:
As my understanding, seems to be a problem with the "node-expat" module, which I suspect that is coming from "xml2json" library. Any thougts?
EDIT 1:
I tried to do a re-install of node-expat, by running "npm install node-expat" as ADMINISTRATOR, and by looking at the log I see the following:
48 warn kissArteNode#1.0.0 No repository field.
49 verbose stack Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
49 verbose stack at Error (native)
50 verbose cwd C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs
51 verbose Windows_NT 6.1.7601
52 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\a0717016\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-expat"
53 verbose node v6.11.0
54 verbose npm v5.6.0
55 error path C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node
56 error code EPERM
57 error errno -4048
58 error syscall unlink
59 error Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
59 error at Error (native)
59 error { Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
59 error at Error (native)
59 error cause:
59 error { Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
59 error at Error (native)
59 error errno: -4048,
59 error code: 'EPERM',
59 error syscall: 'unlink',
59 error path: 'C:\\Projects\\APP002-01\\src\\arte\\AON.PhoenixRuleEngine.Arte\\NodeJs\\node_modules\\.node-expat.DELETE\\build\\Release\\node_expat.node' },
59 error stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Projects\\APP002-01\\src\\arte\\AON.PhoenixRuleEngine.Arte\\NodeJs\\node_modules\\.node-expat.DELETE\\build\\Release\\node_expat.node\'\n at Error (native)',
59 error errno: -4048,
59 error code: 'EPERM',
59 error syscall: 'unlink',
59 error path: 'C:\\Projects\\APP002-01\\src\\arte\\AON.PhoenixRuleEngine.Arte\\NodeJs\\node_modules\\.node-expat.DELETE\\build\\Release\\node_expat.node',
59 error parent: 'kissArteNode' }
60 error Please try running this command again as root/Administrator.
61 verbose exit [ -4048, true ]
Why is requesting on running as admin again?
I'm facing exactly the same issue that this post: vscode on Windows 10: Activating extension … failed: Module did not self-register
The issue seems to be more related with VS Code rather than npm and nodejs.
In my case, was enough to delete the ".vscode" folder that contains the "launch.json" file. For some reason, I believe that the configured port on debug mode, was conflicting with some other application and that prevented to load the "node-expat" module properly. It had nothing to do with Nodejs and npm as I suspected.
I was also facing the same issue on linux rhel 7, see if it works for you too, what I found out was that I needed to install gcc libraries on my instance, so I went ahead and removed my node_modules folder and then ran the sudo yum group install "Development Tools", and I then ran the npm install again and it worked!
Also, there is a dependency on python, so if the above step doesn't resolve this, you may want to install python too.
Hope this helps, for issues related to installing gcc libraries and Development tools, one can refer to this url also: Install gcc and dev tools
I am using Mac machine
Running the following command which i got from phonegap site.
sudo npm install -g phonegap
But getting the error as follows
8398 error Error: ENOENT, lstat
'/usr/local/lib/node_modules/phonegap/node_modules/connect-phonegap/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js'
8399 error If you need help, you may report this log at: 8399 error
http://github.com/isaacs/npm/issues 8399 error or email it to: 8399
error 8400 error System Darwin 14.0.0 8401
error command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
"-g" "phonegap" 8402 error cwd /Users/bunty 8403 error node -v v0.10.0
8404 error npm -v 1.2.14 8405 error path
/usr/local/lib/node_modules/phonegap/node_modules/connect-phonegap/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js 8406 error fstream_path
/usr/local/lib/node_modules/phonegap/node_modules/connect-phonegap/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js 8407 error fstream_type File 8408 error fstream_class FileWriter 8409
error code ENOENT 8410 error errno 34 8411 error fstream_stack
/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
8411 error fstream_stack Object.oncomplete (fs.js:93:15) 8412 verbose
exit [ 34, true ]
Can anyone help on this?
Thanks in advance