Vue Cli installation error when changing the prefix - vue.js

I tried to install vue/cli, but it wouldn't work. I'm not sure why it wouldn't work. My node version is v14.15.1.
It would show this error:
3256 error code EPERM
3257 error syscall mkdir
3258 error path C:\Program Files\nodejs\node_modules\#vue
3259 error errno -4048
3260 error Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\#vue'
3260 error [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\#vue'] {
3260 error errno: -4048,
3260 error code: 'EPERM',
3260 error syscall: 'mkdir',
3260 error path: 'C:\\Program Files\\nodejs\\node_modules\\#vue'
3260 error }
3261 error The operation was rejected by your operating system.
3261 error It's possible that the file was already in use (by a text editor or antivirus),
3261 error or that you lack permissions to access it.
3261 error
3261 error If you believe this might be a permissions issue, please double-check the
3261 error permissions of the file and its containing directories, or try running
3261 error the command again as root/Administrator.
3262 verbose exit -4048
so I typed
npm set prefix 'C:\Users\User\AppData\Roaming\npm'
and then this would show up
Error: EINVAL: invalid argument, mkdir 'C:\Users\user\'C:\Users\User\AppData\Roaming\npm''
Error: EINVAL: invalid argument, mkdir 'C:\Users\user\'C:\Users\User\AppData\Roaming\npm''
Hope someone can help find the error and fix it.

Related

Azure Pipeline build error Npm failed with return code: 4294963238

I am getting NPM error when I am trying to build the solution as follows
144812 error Windows_NT 10.0.17763
144813 error argv "C:\\hostedtoolcache\\windows\\node\\6.17.1\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\6.17.1\\x64\\node_modules\\npm\\bin\\npm-cli.js" "install"
144814 error node v6.17.1
144815 error npm v3.10.10
144816 error path D:\a\45\s\Presentation Tier\VendorPortal.Web.UI\node_modules\.staging\#types\node-b1eb4de5\package.json
144817 error code ENOTDIR
144818 error errno -4058
144819 error syscall open
144820 error ENOENT: no such file or directory, open 'D:\a\45\s\Presentation Tier\VendorPortal.Web.UI\node_modules\.staging\#types\node-b1eb4de5\package.json'
144821 error If you need help, you may report this error at:
144821 error <https://github.com/npm/npm/issues>
144822 verbose exit [ -4058, true ]
##[error]Error: Npm failed with return code: 4294963238
I tried delete package-lock.json, npm cache clean command, npm install npm#latest -g everything. But I am still getting the error. Error occurs in NPM install step.

Error: EPERM: operation not permitted NPM ISSUE

When I do npm install express I get this error
Error: EPERM: operation not permitted, mkdir 'C:\Program Files\Git\usr\local'
enter image description here

npm cannot install packages, access denied to .npm cache folder

When running npm install on a local project, I get this error:
npm ERR! Error: EACCES: permission denied. The operation was rejected by your operating system. It is likely you do not have the permissions to access this file as the current user
For unclear reasons, it seems that a global .npm folder is causing the troubles.
path /Users/erik/.npm/_cacache/index-v5/ab/a6/079836a3c186b5fd2d717a4
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied
I tried forcing the install with sudo npm install but then I get these errors:
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
Worst of all, it seems that npm is no longer working now, when executing any npm command I get this very weird error
npm -v
const path = i >= 0 ? args[i] : process.cwd(); Error: ENOENT: no such file or directory, uv_cwd
How can I fix these permission issues? Even locally I am not allowed to use npm install.

npm - install angular/cli from local package(offline)

I want to install angular/cli from a local package, I have downloaded the package folder with package.json and all the rest of the files:
bin
commands
CONTRIBUTING.md
ember-cli
lib
LICENSE
models
node_modules
package.json
plugins
README.md
tasks
upgrade
utilities
I have tried npm install 'path/to/package' and the error log :
6041 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "C:\\Users\\t207322\\AppData\\Roaming\\npm-cache\\#angular\\cli\\1.4.4\\package"
6042 verbose node v9.3.0
6043 verbose npm v5.5.1
6044 error path C:\Users\t207322\node_modules\cryptiles\node_modules
6045 error code EPERM
6046 error errno -4048
6047 error syscall scandir
6048 error Error: EPERM: operation not permitted, scandir 'C:\Users\t207322\node_modules\cryptiles\node_modules'
6048 error { Error: EPERM: operation not permitted, scandir 'C:\Users\t207322\node_modules\cryptiles\node_modules'
6048 error stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Users\\t207322\\node_modules\\cryptiles\\node_modules\'',
6048 error errno: -4048,
6048 error code: 'EPERM',
6048 error syscall: 'scandir',
6048 error path: 'C:\\Users\\t207322\\node_modules\\cryptiles\\node_modules' }
6049 error Please try running this command again as root/Administrator.
6050 verbose exit [ -4048, true ]
I had also tried inserting the package to 'AppData\Roaming\npm-cache' and running npm link with same result :
2017 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "link"
2018 verbose node v9.3.0
2019 verbose npm v5.5.1
2020 error path C:\Users\t207322\AppData\Roaming\npm-cache\#angular\cli\1.4.4\package\node_modules\scss-tokenizer\node_modules
2021 error code EPERM
2022 error errno -4048
2023 error syscall scandir
2024 error Error: EPERM: operation not permitted, scandir 'C:\Users\t207322\AppData\Roaming\npm-cache\#angular\cli\1.4.4\package\node_modules\scss-tokenizer\node_modules'
2024 error { Error: EPERM: operation not permitted, scandir 'C:\Users\t207322\AppData\Roaming\npm-cache\#angular\cli\1.4.4\package\node_modules\scss-tokenizer\node_modules'
2024 error stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Users\\t207322\\AppData\\Roaming\\npm-cache\\#angular\\cli\\1.4.4\\package\\node_modules\\scss-tokenizer\\node_modules\'',
2024 error errno: -4048,
2024 error code: 'EPERM',
2024 error syscall: 'scandir',
2024 error path: 'C:\\Users\\t207322\\AppData\\Roaming\\npm-cache\\#angular\\cli\\1.4.4\\package\\node_modules\\scss-tokenizer\\node_modules' }
2025 error Please try running this command again as root/Administrator.
2026 verbose exit [ -4048, true ]
So, is there another way to install a angular/cli using a local package?

Node.js NPM error when installing PhoneGap on Windows 8

I don't know if it's just too early in the morning but I can't figure out this error
18075 error Error: ENOENT, lstat 'C:\Users\Philippe\node_modules\phonegap\node_modules\cordova\node_modules\plugman\node_modules\npm\html\doc\api\npm-prune.html'
18076 error If you need help, you may report this log at:
18076 error <http://github.com/isaacs/npm/issues>
18076 error or email it to:
18076 error <npm-#googlegroups.com>
18077 error System Windows_NT 6.2.9200
18078 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "phonegap"
18079 error cwd C:\Users\Philippe
18080 error node -v v0.10.18
18081 error npm -v 1.3.8
18082 error path C:\Users\Philippe\node_modules\phonegap\node_modules\cordova\node_modules\plugman\node_modules\npm\html\doc\api\npm-prune.html
18083 error fstream_path C:\Users\Philippe\node_modules\phonegap\node_modules\cordova\node_modules\plugman\node_modules\npm\html\doc\api\npm-prune.html
18084 error fstream_type File
18085 error fstream_class FileWriter
18086 error code ENOENT
18087 error errno 34
18088 error fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
18088 error fstream_stack Object.oncomplete (fs.js:107:15)
18089 verbose exit [ 34, true ]
I would be very appreciative if someone could give me the short and sweet version.
Thanks
I ran the following commands
npm list -g
it showed me that I have an unmet dependency phonegap... so I ran
npm rm phonegap
npm cache clear
then tried installing it again
npm install -g phonegap
and it worked, the ENOENT error should have been a dead give away that npm was trying to tell me that the supposed files didn't exist or were corrupted.
#Torvos answer: please note sometimes you must run
npm rm -g phonegap
(at least for me this was the case; without -g option it didn't work)