Node.js SurfaceBook Win10 : #angular/cli will not install - node.js

Tech details:
SurfaceBook/win10 up to date;
Node.js 8.9.4 x64
Using an admin account
The goal was to take an app (nothing special about the web app) and make it run on this laptop. It works fine on my other devices (win7 and Linux).
I tried to solve the problem with other answers from StackOverflow. I went through : Removing files (Appdata/roaming/npm & npm-cache); uninstall node.js, reinstall and such. Nothing works.
I have a strange message when using NPM (the win version) in cmd.exe prompt. But it does not talk much under Git bash.
C:\Users\TexMex>npm -v
'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
5.6.0
C:\Users\TexMex>
The Git Bash is more silent. It doesn't mean it's not going through the same problem. The "PATH" environment variableS are set properly according to other StackOverflow answers. Still... it works... Ok it's not that of a problem as long as it works.
When installing packages everything goes well until #Angular/cli. I end up with this "uglify postinstall" error every time.
[...]
34735 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
34737 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.7.2 (node_modules\#angular\cli\node_modules\node-sass):
34738 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.7.2 install: `node scripts/install.js`
34738 warn optional SKIPPING OPTIONAL DEPENDENCY: spawn C:\WINDOWS\system32\cmd.exe; ENOENT
34739 verbose optional SKIPPING OPTIONAL DEPENDENCY:
34739 verbose optional Failed at the node-sass#4.7.2 install script.
34739 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
34740 verbose stack Error: uglifyjs-webpack-plugin#0.4.6 postinstall: `node lib/post_install.js`
34740 verbose stack spawn C:\WINDOWS\system32\cmd.exe; ENOENT
34740 verbose stack at _errnoException (util.js:1022:11)
34740 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
34740 verbose stack at onErrorNT (internal/child_process.js:372:16)
34740 verbose stack at _combinedTickCallback (internal/process/next_tick.js:138:11)
34740 verbose stack at process._tickCallback (internal/process/next_tick.js:180:9)
34741 verbose pkgid uglifyjs-webpack-plugin#0.4.6
34742 verbose cwd C:\Users\TexMex\Desktop\DEV\git
34743 verbose Windows_NT 10.0.16299
34744 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "--save-dev" "#angular/cli#latest"
34745 verbose node v8.9.4
34746 verbose npm v5.6.0
34747 error file C:\WINDOWS\system32\cmd.exe;
34748 error path C:\WINDOWS\system32\cmd.exe;
34749 error code ELIFECYCLE
34750 error errno ENOENT
34751 error syscall spawn C:\WINDOWS\system32\cmd.exe;
34752 error uglifyjs-webpack-plugin#0.4.6 postinstall: `node lib/post_install.js`
34752 error spawn C:\WINDOWS\system32\cmd.exe; ENOENT
34753 error Failed at the uglifyjs-webpack-plugin#0.4.6 postinstall script.
34753 error This is probably not a problem with npm. There is likely additional logging output above.
34754 verbose exit [ 1, true ]
The thing is it prevents #angular/cli directory to be created and the corresponding files to be "landed" here (global install or not). the 'ng' command is not available as a result (it's embarrassing).
I did my homework tried all the StackOverflow answer i could find; and I'm out of ideas.
Maybe it's some spurts in the windows registry (some previous install of nodeJS)?? but what are the keys to remove from the registry if there is??? Is it relevant to clean the registry in that case? Is it specific to surface book ??? All this would be weird.
So the final question is :
How do I make it work, 100% sure shot?
Bottle in the sea... Help.

I think i found the root cause of the problem.
It seems that an online Microsoft account (which is easily activated when using W10 and SurfaceBooks) forbids software to modify some directory in the user home directory. This directory (or part of it) is somehow synchronized with the Microsoft service.
So you cannot "mess" with it like if it was only local. Those directories appear like system protected directories when using the service. When not using it; they're just hidden like you all probably know. "AppData" and such are the ones who are synchronized.
Also, I would recommend to use NodeJs/Angular with Docker. Especially as Angular is regularly updated since version 4.

Related

"npm install" error on an Azure App / Web Service: EPERM: operation not permitted, lchown

On a Linux Azure App / Web Service configured for Node 12 LTS, after uploading code assets to /home/site/wwwroot/, which includes a package.json file, I run npm install as root. I get the exception shown further below.
This same exception happens across two different Azure App / Web Services, one for a UI and another for a API (so two different code-sets). But the error-pattern is the same:
It cannot change the ownership of a directory beneath /home/site/wwwroot/node_modules/[...]/build-optimizer/node_modules/.bin/, but only because the .../.bin/ sub-directory itself never gets created.
Again, I'm running npm install as root in both cases.
Any ideas? Please see below and thank you.
24380 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/fsevents):
24381 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
24383 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.1 (node_modules/karma/node_modules/fsevents):
24384 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
24386 verbose stack Error: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/#angular-devkit/build-optimizer/node_modules/.bin/tsserver'
24387 verbose cwd /home/site/wwwroot
24388 verbose Linux 4.15.0-112-generic
24389 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
24390 verbose node v12.19.0
24391 verbose npm v6.14.8
24392 error code EPERM
24393 error syscall lchown
24394 error path /home/site/wwwroot/node_modules/#angular-devkit/build-optimizer/node_modules/.bin/tsserver
24395 error errno -1
24396 error Error: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/#angular-devkit/build-optimizer/node_modules/.bin/tsserver'
24396 error [OperationalError: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/#angular-devkit/build-optimizer/node_modules/.bin/tsserver'] {
24396 error cause: [Error: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/#angular-devkit/build-optimizer/node_modules/.bin/tsserver'] {
24396 error errno: -1,
24396 error code: 'EPERM',
24396 error syscall: 'lchown',
24396 error path: '/home/site/wwwroot/node_modules/#angular-devkit/build-optimizer/node_modules/.bin/tsserver'
24396 error },
24396 error errno: -1,
24396 error code: 'EPERM',
24396 error syscall: 'lchown',
24396 error path: '/home/site/wwwroot/node_modules/#angular-devkit/build-optimizer/node_modules/.bin/tsserver',
24396 error parent: '#angular-devkit/build-optimizer'
24396 error }
24397 error The operation was rejected by your operating system.
24397 error It is likely you do not have the permissions to access this file as the current user
24397 error
24397 error If you believe this might be a permissions issue, please double-check the
24397 error permissions of the file and its containing directories, or try running
24397 error the command again as root/Administrator.
24398 verbose exit [ -1, true ]
Had the exact same issue. Thanks to comment from semkeijsper the solution worked for me is: in package.json:
npm install
is modified to:
"npm cache clean --force && npm install"

Response timeout while trying to fetch https://registry.npmjs.com/pacote

I cant install nativescript-cli with npm when I run npm install nativescript -g. I dont know what is the reason.
node --version => 12.16.2
npm --version => 6.14.4
I tried :
-delete cache folder and npm cache clean --force
-npm config set registry http://registry.npmjs.com
-turn off anti malware
but the issue is still unresolved.
here is npm log file output
11148 warn tar ENOENT: no such file or directory, open 'C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging\es5-ext-57d686a6\test\function\invoke.js'
11149 warn tar ENOENT: no such file or directory, open 'C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging\es5-ext-57d686a6\function\is-arguments.js'
11150 http fetch GET 200 https://registry.npmjs.org/#sinonjs/commons/-/commons-1.6.0.tgz 22ms (from cache)
11151 verbose unlock done using C:\Users\Mohammad Reza\AppData\Roaming\npm-cache\_locks\staging-60ffea16dce7f1cb.lock for C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging
11152 timing stage:rollbackFailedOptional Completed in 2ms
11153 timing stage:runTopLevelLifecycles Completed in 200098ms
11154 warn optional SKIPPING OPTIONAL DEPENDENCY: #types/node#8.10.30 (node_modules\nativescript\node_modules\#types\node):
11155 warn optional SKIPPING OPTIONAL DEPENDENCY: Response timeout while trying to fetch https://registry.npmjs.com/#types%2fnode (over 30000ms)
11156 warn optional SKIPPING OPTIONAL DEPENDENCY: typescript#3.3.4000 (node_modules\nativescript\node_modules\typescript):
11157 warn optional SKIPPING OPTIONAL DEPENDENCY: Response timeout while trying to fetch https://registry.npmjs.com/typescript (over 30000ms)
11158 verbose type body-timeout
11159 verbose stack FetchError: Response timeout while trying to fetch https://registry.npmjs.com/pacote (over 30000ms)
11159 verbose stack at Timeout._onTimeout (C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\body.js:189:16)
11159 verbose stack at listOnTimeout (internal/timers.js:549:17)
11159 verbose stack at processTimers (internal/timers.js:492:7)
11160 verbose cwd C:\Windows\system32
11161 verbose Windows_NT 10.0.18363
11162 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mohammad Reza\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "nativescript" "-g"
11163 verbose node v12.16.2
11164 verbose npm v6.14.4
11165 error Response timeout while trying to fetch https://registry.npmjs.com/pacote (over 30000ms)
11166 verbose exit [ 1, true ]
I was facing same issue, it seems to be a problem with npm versions 6.14.*. Downgrading to npm#6.13.1 worked for me.
npm i npm#6.13.1 -g
I've faced this issue and I tried all the answers on Stackoverflow but not worked for me, finally I found solution for this issue:
First of all you have to uninstall nodejs and remove all the files related him
Go to "Register Editor" and search for all "nodejs", "node.js" and delete them
Restart your computer
And reinstall nodejs then install angular.
it's worked for me,
good luck :)

Install node-sass on plesk

Ive been looking online for a solution to installing node-sass on my plesk server. I read that this is kind of a no no as this should not be done on a production server(dont care - not a live site).
I have uploaded the documents via bitbucket and click the NPM install button. The result is the failure below:
3822 verbose stack Error: node-sass#4.12.0 install: `node scripts/install.js`
3822 verbose stack spawn ENOENT
3822 verbose stack at ChildProcess.<anonymous> (/opt/plesk/node/9/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
3822 verbose stack at ChildProcess.emit (events.js:180:13)
3822 verbose stack at maybeClose (internal/child_process.js:936:16)
3822 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
3823 verbose pkgid node-sass#4.12.0
3824 verbose cwd /var/www/vhosts/mjmnagy.info/app
3825 verbose Linux 3.10.0-862.9.1.el7.x86_64
3826 verbose argv "/opt/plesk/node/9/bin/node" "/opt/plesk/node/9/bin/npm" "install"
3827 verbose node v9.10.1
3828 verbose npm v5.6.0
3829 error file sh
3830 error code ELIFECYCLE
3831 error errno ENOENT
3832 error syscall spawn
3833 error node-sass#4.12.0 install: `node scripts/install.js`
3833 error spawn ENOENT
3834 error Failed at the node-sass#4.12.0 install script.
3834 error This is probably not a problem with npm. There is likely additional logging output above.
3835 verbose exit [ 1, true ]
I attempted to login to the server using SSH but for the life of me couldn't figure out how to install it.
Using SSH, i navigated to where node is install (/opt/plesk/node/7/bin/) trying 6/7/8 and then running npm. i always got unrecognized command.
I then realized that the version i have of node-sass was higher than the node version install on the server(9.10.1)
What do i need to do to be able to install the module?
ignore plesks NPM install button and create a script in your package.json
"installme": "npm i --unsafe-perms"
Using plesk run the script
installme --scripts-node-prepend-path

Can't install any packages with Node.js [duplicate]

This question already has answers here:
Error: Cannot find module '#ionic/app-scripts'
(18 answers)
Closed 3 years ago.
I'm an absolute novice in Ionic, Cordova and Node.js.
I have the following problem with Node.js:
I got a project from a colleague created with ionic and cordova. The app itself is also running, for a special customer, we have adapted the design. My thought was that it was done quickly. I changed my branch in GIT to the corresponding project and wanted to do it. Unfortunately, I get countless error messages and warnings that I did not have in the previous project.
I uninstalled Node.js and reinstalled it completely, unfortunately nothing has changed. I can not uninstall or install any of the packages. I always get this eternally long error message and I do not know exactly what the problem is. Uninstalling Ionic and cordova does not work either, same error message. Below is a listing of my version of Node.js, Ionic and cordova and the beginning and end of the error message.
Console:gitproject user$ git branch
* development
master
Console:gitproject user$ ionic cordova build
? What platform would you like to build (android, ios): ios
> ionic-app-scripts build --target cordova --platform ios
[08:44:43] ionic-app-scripts 3.2.3
[08:44:43] build dev started ...
[08:44:43] clean started ...
[08:44:43] clean finished in 24 ms
[08:44:43] copy started ...
[08:44:43] deeplinks started ...
[08:44:44] deeplinks finished in 593 ms
[08:44:44] transpile started ...
[08:44:56] typescript: src/app/app.component.ts, line: 34
Cannot find name 'Globalization'.
L33: private translate: TranslateService,
L34: private globalization: Globalization) {
L35: platform.ready().then(() => {
[08:44:56] ionic-app-script task: "build"
[08:44:56] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/transpile.js:159:20
at new Promise (<anonymous>)
at transpileWorker (/path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/transpile.js:107:12)
at Object.transpile (/path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/transpile.js:64:12)
at /path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/build.js:109:82
[ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts build --target cordova --platform ios exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Console:gitproject user$ ionic cordova plugin add cordova-plugin-globalization
> cordova plugin add cordova-plugin-globalization --save
Installing "cordova-plugin-globalization" for ios
Unable to load PlatformApi from platform. Error: Cannot find module 'unorm'
Require stack:
- /path/to/project/gitproject/platforms/ios/cordova/Api.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/plugman.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/cordova-lib.js
- /usr/local/lib/node_modules/cordova/src/help.js
- /usr/local/lib/node_modules/cordova/src/cli.js
- /usr/local/lib/node_modules/cordova/bin/cordova
Failed to install 'cordova-plugin-globalization': Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('The platform "ios" does not appear to be a valid ' +
'cordova platform. It is missing API.js. ios not ' +
'supported.')
at CordovaEventEmitter.emit (events.js:185:17)
at CordovaEventEmitter.emit (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/events.js:69:22)
at Object.getPlatformApiFunction (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:384:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:55:32)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:580:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:349:28
at processTicksAndRejections (internal/process/task_queues.js:89:5)
Unhandled error. ('The platform "ios" does not appear to be a valid ' +
'cordova platform. It is missing API.js. ios not ' +
'supported.')
Console:gitproject user$ npm install #ionic-native/globalization
> fsevents#1.2.4 install /path/to/project/gitproject/node_modules/fsevents
> node install
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v72-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents#1.2.4 and node#12.2.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
...
...
...
...
10 warnings and 8 errors generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/path/to/project/gitproject/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/path/to/project/gitproject/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /path/to/project/gitproject/node_modules/node-sass
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /path/to/user/folder/.npm/_logs/2019-05-27T08_04_02_672Z-debug.log
Here is the edition from the above mentioned error log
2653 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
2654 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 install: `node install`
2654 warn optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
2655 verbose optional SKIPPING OPTIONAL DEPENDENCY:
2655 verbose optional Failed at the fsevents#1.2.4 install script.
2655 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
2656 verbose stack Error: node-sass#4.9.0 postinstall: `node scripts/build.js`
2656 verbose stack Exit status 1
2656 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
2656 verbose stack at EventEmitter.emit (events.js:200:13)
2656 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
2656 verbose stack at ChildProcess.emit (events.js:200:13)
2656 verbose stack at maybeClose (internal/child_process.js:1021:16)
2656 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
2657 verbose pkgid node-sass#4.9.0
2658 verbose cwd /Users/premox/Documents/projects/gitproject
2659 verbose Darwin 18.6.0
2660 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "uninstall" "sass"
2661 verbose node v12.3.1
2662 verbose npm v6.9.0
2663 error code ELIFECYCLE
2664 error errno 1
2665 error node-sass#4.9.0 postinstall: `node scripts/build.js`
2665 error Exit status 1
2666 error Failed at the node-sass#4.9.0 postinstall script.
2666 error This is probably not a problem with npm. There is likely additional logging output above.
2667 verbose exit [ 1, true ]
Console:gitproject user$ node -v
v12.3.1
Console:gitproject user$ npm -v
6.9.0
Can someone explain this error message to me?
There are a couple of things you can do in order to setup the project correctly.
Check if node, ionic and cordova are properly installed.
Completely delete the node modules folder and then run the following command:-
npm install
This would install all the dependencies in the project.
If above doesnot work then you can try, same step mentioned by Ashok to resolve:-
npm install #ionic/app-scripts#latest --save-dev
Please let me know if you have any questions.

Can't install NPM dependencies on Windows 10

Not too sure what's changed with Node.js and NPM recently (i.e. in the last several days) but I can't seem to find a way to install node_modules dependencies for any projects using Node.js on Windows 10 anymore...
My current setup is as follows:
Node.js: v9.5.0
NPM: v5.6.0
Vue.js: v2.9.3
I've tried clearing the cache prior to install: npm cache clear -f
Any time I attempt to run npm i or npm install I'm presented with the following list of errors:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\.staging\fsevents-a6c1bd51\node_modules\abbrev' -> 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\.staging\abbrev-3ab84c45'
npm ERR! path C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\acorn
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\acorn' -> 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\.acorn.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mbosse\AppData\Roaming\npm-cache\_logs\2018-02-14T18_27_56_988Z-debug.log
The specified debug.log contains the follow:
19859 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3
(node_modules\fsevents):
19860 warn optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules.staging\fsevents-a6c1bd51\node_modules\abbrev' -> 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules.staging\abbrev-3ab84c45'
19861 verbose optional SKIPPING OPTIONAL DEPENDENCY:
19861 verbose optional Please try running this command again as root/Administrator.
19862 verbose stack Error: ENOENT: no such file or directory, rename 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\acorn' -> 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules.acorn.DELETE'
19863 verbose cwd C:\xampp\htdocs\vue-scrolling-table-sample
19864 verbose Windows_NT 10.0.14393
19865 verbose argv "C:\ProgramFiles\nodejs\node.exe" "C:\ProgramFiles\nodejs\node_modules\npm\bin\npm-cli.js" "i"
19866 verbose node v9.5.0
19867 verbose npm v5.6.0
19868 error path C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\acorn
19869 error code ENOENT
19870 error errno -4058
19871 error syscall rename
19872 error enoent ENOENT: no such file or directory, rename 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules\acorn' -> 'C:\xampp\htdocs\vue-scrolling-table-sample\node_modules.acorn.DELETE'
19873 error enoent This is related to npm not being able to find a file.
19874 verbose exit [ -4058, true ]
So it seems, for some reason, NPM is incapable of renaming node_modules dependencies.
I've tried rolling back NPM to earlier version (in case npm#latest is not stable enough).
Using nvm I've completely uninstalled all versions of Node.js and NPM and reinstalled them. I've since tried installing my dependencies on a Node.js v6.11.3 setup as well as a Node.js v8.9.4 with the identical outcome.
Any suggestions would be very beneficial, thank you!
Possible duplicate => npm ERR! Error: EPERM: operation not permitted, rename
Steps:
npm cache clean --force
npm install
If and only IF this doesn't work what I did was erasing the node_modules folder and package-lock.json (if you have the last one) and repeat steps 1 and 2
If possibly you have renamed your package.json and the name does not match your package-lock.json
To resolve this error open your package.json and package-lock.json to check if the "name" key has the same value.
If not change then change them to match your project name.
Example if your project name is todo-list then the "name" value can be todo-list. Note, this is not compulsory.

Resources